[PATCH 3/3] network: Fix dead assignment in connect_cb

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

 



Value stored to err_msg is never read in case err was not NULL.
Simply remove err_msg and pass strerror() directly where it is used.

---
 profiles/network/connection.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/profiles/network/connection.c b/profiles/network/connection.c
index abcbee8..1a1fb4d 100644
--- a/profiles/network/connection.c
+++ b/profiles/network/connection.c
@@ -371,19 +371,16 @@ static int bnep_connect(struct network_conn *nc)
 static void connect_cb(GIOChannel *chan, GError *err, gpointer data)
 {
 	struct network_conn *nc = data;
-	const char *err_msg;
 	int perr;
 
 	if (err) {
 		error("%s", err->message);
-		err_msg = err->message;
 		goto failed;
 	}
 
 	perr = bnep_connect(nc);
 	if (perr < 0) {
-		err_msg = strerror(-perr);
-		error("bnep connect(): %s (%d)", err_msg, -perr);
+		error("bnep connect(): %s (%d)", strerror(-perr), -perr);
 		goto failed;
 	}
 
-- 
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