alias = avl_find_element(&aliases, name, alias, avl);
if (!alias)
- return;
+ goto out;
alias->cleanup = !dev;
if (dev) {
device_broadcast_event(&alias->dev, DEV_EVENT_UPDATE_IFNAME);
}
+out:
device_unlock();
}
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);
ret = interface_remove_link(iface, dev);
}
+out:
device_unlock();
return ret;