Thread (8 messages) 8 messages, 4 authors, 2014-01-27

[PATCH 1/3] bnep: Calculate ifindex after NULL check

flat view
STALE4640d

From: Andrei Emeltchenko <hidden>
Date: 2014-01-24 14:56:41
Subsystem: the rest · Maintainer: Linus Torvalds

From: Andrei Emeltchenko <redacted>

---
 profiles/network/bnep.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/profiles/network/bnep.c b/profiles/network/bnep.c
index 2a74016..0ef85d5 100644
--- a/profiles/network/bnep.c
+++ b/profiles/network/bnep.c
@@ -518,13 +518,15 @@ static int bnep_add_to_bridge(const char *devname, const char *bridge)
 
 static int bnep_del_from_bridge(const char *devname, const char *bridge)
 {
-	int ifindex = if_nametoindex(devname);
+	int ifindex;
 	struct ifreq ifr;
 	int sk, err;
 
 	if (!devname || !bridge)
 		return -EINVAL;
 
+	ifindex = if_nametoindex(devname);
+
 	sk = socket(AF_INET, SOCK_STREAM, 0);
 	if (sk < 0)
 		return -1;
-- 
1.8.3.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help