[PATCH v2 BlueZ 3/6] input: Remove unnecessary goto label

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux