projects
/
project
/
netifd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6653b86
)
fix device_lock/device_unlock imbalances
author
Felix Fietkau
<nbd@openwrt.org>
Fri, 19 Oct 2012 13:48:52 +0000
(15:48 +0200)
committer
Felix Fietkau
<nbd@openwrt.org>
Fri, 19 Oct 2012 13:48:52 +0000
(15:48 +0200)
alias.c
patch
|
blob
|
history
ubus.c
patch
|
blob
|
history
diff --git
a/alias.c
b/alias.c
index
07ed5fe
..
72018d4
100644
(file)
--- a/
alias.c
+++ b/
alias.c
@@
-108,7
+108,7
@@
alias_notify_device(const char *name, struct device *dev)
alias = avl_find_element(&aliases, name, alias, avl);
if (!alias)
alias = avl_find_element(&aliases, name, alias, avl);
if (!alias)
-
return
;
+
goto out
;
alias->cleanup = !dev;
if (dev) {
alias->cleanup = !dev;
if (dev) {
@@
-128,6
+128,7
@@
alias_notify_device(const char *name, struct device *dev)
device_broadcast_event(&alias->dev, DEV_EVENT_UPDATE_IFNAME);
}
device_broadcast_event(&alias->dev, DEV_EVENT_UPDATE_IFNAME);
}
+out:
device_unlock();
}
device_unlock();
}
diff --git
a/ubus.c
b/ubus.c
index
be9e632
..
3ea71bf
100644
(file)
--- a/
ubus.c
+++ b/
ubus.c
@@
-595,8
+595,10
@@
netifd_iface_handle_device(struct ubus_context *ctx, struct ubus_object *obj,
device_lock();
dev = device_get(blobmsg_data(tb[DEV_NAME]), add ? 2 : 0);
device_lock();
dev = device_get(blobmsg_data(tb[DEV_NAME]), add ? 2 : 0);
- if (add && !dev)
- return UBUS_STATUS_NOT_FOUND;
+ if (add && !dev) {
+ ret = UBUS_STATUS_NOT_FOUND;
+ goto out;
+ }
if (add) {
device_set_present(dev, true);
if (add) {
device_set_present(dev, true);
@@
-609,6
+611,7
@@
netifd_iface_handle_device(struct ubus_context *ctx, struct ubus_object *obj,
ret = interface_remove_link(iface, dev);
}
ret = interface_remove_link(iface, dev);
}
+out:
device_unlock();
return ret;
device_unlock();
return ret;