diff options
author | Nathan Hintz <nlhintz@hotmail.com> | 2013-01-05 18:41:45 -0800 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2013-01-06 04:09:24 +0100 |
commit | 16e21f6b33c40895cda27af4bc9f3bd0136d2482 (patch) | |
tree | 39c42058e67284c5dca4c9d7e48b280ef6928e6c | |
parent | 4108e7610019d63db6540de760feecf38c8b84dc (diff) |
fix removal of unknown device
Netifd will crash if an attempt is made to remove a device that is not
known to netifd. For instance:
ubus call network.interface.lan remove_device "{ \"name\": \"xxx\" }"
Signed-off-by: Nathan Hintz <nlhintz@hotmail.com>
-rw-r--r-- | ubus.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -592,7 +592,7 @@ 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) { + if (!dev) { ret = UBUS_STATUS_NOT_FOUND; goto out; } |