netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC, PATCH] net: suspicious test in dev_change_name()
@ 2009-10-30  9:20 Eric Dumazet
  2009-10-30 23:50 ` Jarek Poplawski
  0 siblings, 1 reply; 7+ messages in thread
From: Eric Dumazet @ 2009-10-30  9:20 UTC (permalink / raw)
  To: David S. Miller; +Cc: Linux Netdev List

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@gmail.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",

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-11-16 11:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-30  9:20 [RFC, PATCH] net: suspicious test in dev_change_name() Eric Dumazet
2009-10-30 23:50 ` Jarek Poplawski
2009-11-02  8:05   ` David Miller
2009-11-16  9:30     ` [PATCH net] net: Fix the rollback " Jarek Poplawski
2009-11-16 10:49       ` David Miller
2009-11-16 11:08         ` Eric Dumazet
2009-11-16 11:31           ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).