[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080514181543.744b8286@extreme>
Date: Wed, 14 May 2008 18:15:43 -0700
From: Stephen Hemminger <shemminger@...tta.com>
To: Greg KH <greg@...ah.com>, David Miller <davem@...emloft.net>,
fubar@...ibm.com
Cc: netdev@...r.kernel.org, bonding-devel@...ts.sourceforge.net,
linux-kernel@...r.kernel.org
Subject: [PATCH 1/3] net: handle errors from device_rename
device_rename can fail with -EEXIST or -ENOMEM, so handle any problems.
Signed-off-by: Stephen Hemminger <shemminger@...tta.com>
--- a/net/core/dev.c 2008-05-14 17:49:37.000000000 -0700
+++ b/net/core/dev.c 2008-05-14 17:51:21.000000000 -0700
@@ -903,7 +903,11 @@ int dev_change_name(struct net_device *d
strlcpy(dev->name, newname, IFNAMSIZ);
rollback:
- device_rename(&dev->dev, dev->name);
+ err = device_rename(&dev->dev, dev->name);
+ if (err) {
+ memcpy(dev->name, oldname, IFNAMSIZ);
+ return err;
+ }
write_lock_bh(&dev_base_lock);
hlist_del(&dev->name_hlist);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists