From: Eric Dumazet <eric.dumazet@gmail.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: Linux Netdev List <netdev@vger.kernel.org>
Subject: [RFC, PATCH] net: suspicious test in dev_change_name()
Date: Fri, 30 Oct 2009 10:20:04 +0100 [thread overview]
Message-ID: <4AEAAFC4.9050309@gmail.com> (raw)
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",
next reply other threads:[~2009-10-30 9:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-30 9:20 Eric Dumazet [this message]
2009-10-30 23:50 ` [RFC, PATCH] net: suspicious test in dev_change_name() 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
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=4AEAAFC4.9050309@gmail.com \
--to=eric.dumazet@gmail.com \
--cc=davem@davemloft.net \
--cc=netdev@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;
as well as URLs for NNTP newsgroup(s).