projects
/
GitHub
/
LineageOS
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8f40f67
)
net: handle errors from device_rename
author
Stephen Hemminger
<shemminger@vyatta.com>
Thu, 15 May 2008 05:33:38 +0000
(22:33 -0700)
committer
David S. Miller
<davem@davemloft.net>
Thu, 15 May 2008 05:33:38 +0000
(22:33 -0700)
device_rename can fail with -EEXIST or -ENOMEM, so handle any
problems.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev.c
patch
|
blob
|
blame
|
history
diff --git
a/net/core/dev.c
b/net/core/dev.c
index a1607bc0cd4cd3601b2183616845b564a1057c52..ce88c0d3e35470d1c052a0ed8b92d2dbd4a7f5f3 100644
(file)
--- a/
net/core/dev.c
+++ b/
net/core/dev.c
@@
-903,7
+903,11
@@
int dev_change_name(struct net_device *dev, char *newname)
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);