Fixes observed issue a tunnel interface is reported as up although device_claim failed
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
device_add_user(&iface->l3_dev, dev);
if (dev) {
- if (claimed)
- device_claim(&iface->l3_dev);
+ if (claimed) {
+ if (device_claim(&iface->l3_dev) < 0)
+ return;
+ }
interface_ip_set_enabled(&iface->config_ip, enabled);
}
}
return;
}
- if (claimed)
- device_claim(&iface->l3_dev);
+ if (claimed) {
+ if (device_claim(&iface->l3_dev) < 0)
+ return;
+ }
if (!iface->l3_dev.dev)
interface_set_l3_dev(iface, dev);
return UBUS_STATUS_INVALID_ARGUMENT;
interface_set_l3_dev(iface, dev);
- device_claim(&iface->l3_dev);
+ if (device_claim(&iface->l3_dev) < 0)
+ return UBUS_STATUS_UNKNOWN_ERROR;
+
device_set_present(dev, true);
interface_update_start(iface);
}
ret = device_claim(&vldev->dep);
- if (ret)
+ if (ret < 0)
return ret;
system_vlan_add(vldev->dep.dev, vldev->id);