diff options
author | Felix Fietkau <nbd@openwrt.org> | 2012-10-19 15:48:52 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2012-10-19 15:48:52 +0200 |
commit | 30e9a048af138b39ee0d53451da43eddd6f48fda (patch) | |
tree | 85015552d2e36d656cfcd0d0e5235bd6dce7a942 /ubus.c | |
parent | 6653b861748719ab58e21a81e01d59d4d8afe10c (diff) |
fix device_lock/device_unlock imbalances
Diffstat (limited to 'ubus.c')
-rw-r--r-- | ubus.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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); - 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); @@ -609,6 +611,7 @@ netifd_iface_handle_device(struct ubus_context *ctx, struct ubus_object *obj, ret = interface_remove_link(iface, dev); } +out: device_unlock(); return ret; |