From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ 3/3] network: Fix dead assignment in connect_cb
Date: Tue, 13 Nov 2012 15:21:10 +0200 [thread overview]
Message-ID: <1352812880-7306-7-git-send-email-luiz.dentz@gmail.com> (raw)
In-Reply-To: <1352812880-7306-1-git-send-email-luiz.dentz@gmail.com>
From: Szymon Janc <szymon.janc@tieto.com>
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.11.7
next prev parent reply other threads:[~2012-11-13 13:21 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-13 13:21 [PATCH BlueZ 00/13] Remove HFP implementation Luiz Augusto von Dentz
2012-11-13 13:21 ` [PATCH BlueZ 01/13] audio: Remove HFP and HSP headset role support Luiz Augusto von Dentz
2012-11-13 13:21 ` [PATCH BlueZ 1/3] avctp: Fix dead assignment in control_response Luiz Augusto von Dentz
2012-11-13 13:33 ` Luiz Augusto von Dentz
2012-11-13 13:21 ` [PATCH BlueZ 02/13] audio: Remove HFP option from audio.conf Luiz Augusto von Dentz
2012-11-13 13:21 ` [PATCH BlueZ 2/3] avrcp: Fix dead assignments in ct_set_setting Luiz Augusto von Dentz
2012-11-13 13:21 ` [PATCH BlueZ 03/13] audio: Remove code using headset Luiz Augusto von Dentz
2012-11-13 13:21 ` Luiz Augusto von Dentz [this message]
2012-11-13 13:21 ` [PATCH BlueZ 04/13] build: Remove telephony-maemo5.c Luiz Augusto von Dentz
2012-11-13 13:21 ` [PATCH BlueZ 05/13] build: Remove telephony-maemo6.c Luiz Augusto von Dentz
2012-11-13 13:21 ` [PATCH BlueZ 06/13] build: Remove telephony-ofono.c Luiz Augusto von Dentz
2012-11-13 13:21 ` [PATCH BlueZ 07/13] build: Remove telephony-dummy.c Luiz Augusto von Dentz
2012-11-13 13:21 ` [PATCH BlueZ 08/13] build: Remove telephony.h Luiz Augusto von Dentz
2012-11-13 13:21 ` [PATCH BlueZ 09/13] build: Remove headset.c and headset.h Luiz Augusto von Dentz
2012-11-13 13:21 ` [PATCH BlueZ 10/13] audio: Remove code HFP and HS gateway role Luiz Augusto von Dentz
2012-11-13 13:21 ` [PATCH BlueZ 11/13] build: Remove gateway.c and gateway.h Luiz Augusto von Dentz
2012-11-13 13:21 ` [PATCH BlueZ 12/13] audio: Move to profiles directory Luiz Augusto von Dentz
2012-11-13 13:21 ` [PATCH BlueZ 13/13] audio: Add support for passing endpoints as custom property Luiz Augusto von Dentz
2012-11-13 14:16 ` [PATCH BlueZ 00/13] Remove HFP implementation Johan Hedberg
2012-11-13 15:39 ` Luiz Augusto von Dentz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1352812880-7306-7-git-send-email-luiz.dentz@gmail.com \
--to=luiz.dentz@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox