[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <4AEAAFC4.9050309@gmail.com>
Date: Fri, 30 Oct 2009 10:20:04 +0100
From: Eric Dumazet <eric.dumazet@...il.com>
To: "David S. Miller" <davem@...emloft.net>
CC: Linux Netdev List <netdev@...r.kernel.org>
Subject: [RFC, PATCH] net: suspicious test in dev_change_name()
While preparing a patch for net-next-2.6, I noticed following code in dev_change_name()
int err = 0;
...
ret = call_netdevice_notifiers(NETDEV_CHANGENAME, dev);
ret = notifier_to_errno(ret);
if (ret) {
<< HERE >> if (err) {
printk(KERN_ERR
"%s: name change rollback failed: %d.\n",
dev->name, ret);
} else {
err = ret;
memcpy(dev->name, oldname, IFNAMSIZ);
goto rollback;
}
}
It seems intent was to test if notifier_to_errno() was null ?
Signed-off-by: Eric Dumazet <eric.dumazet@...il.com>
---
diff --git a/net/core/dev.c b/net/core/dev.c
index b8f74cf..029cd41 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -939,9 +939,9 @@ rollback:
write_unlock_bh(&dev_base_lock);
ret = call_netdevice_notifiers(NETDEV_CHANGENAME, dev);
- ret = notifier_to_errno(ret);
if (ret) {
+ err = notifier_to_errno(ret);
if (err) {
printk(KERN_ERR
"%s: name change rollback failed: %d.\n",
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists