Instead, use "if (err < 0)" for error handling. --- profiles/input/device.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/profiles/input/device.c b/profiles/input/device.c index ca1ce8b..fc7f8f7 100644 --- a/profiles/input/device.c +++ b/profiles/input/device.c @@ -277,16 +277,13 @@ static void encrypt_completed(uint8_t status, gpointer user_data) int err; err = ioctl_connadd(req); - if (err == 0) - goto cleanup; - - error("ioctl_connadd(): %s(%d)", strerror(-err), -err); - close(req->intr_sock); - close(req->ctrl_sock); + if (err < 0) { + error("ioctl_connadd(): %s(%d)", strerror(-err), -err); + close(req->intr_sock); + close(req->ctrl_sock); + } -cleanup: g_free(req->rd_data); - g_free(req); } -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html