diff options
author | Felix Fietkau <nbd@openwrt.org> | 2011-10-19 02:08:25 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2011-10-19 02:36:45 +0200 |
commit | ccca61c97d460d73f29750abdf38cea20ac440f3 (patch) | |
tree | 8e0c47f21ec7205c54a41811ee17a7aa03fd00eb /device.c | |
parent | f8276b9b149f3b0c8f3cdf8d3d0c232bd92e3464 (diff) |
rework and fix hotplug interface handling
Diffstat (limited to 'device.c')
-rw-r--r-- | device.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -179,8 +179,7 @@ alias_notify_device(const char *name, struct device *dev) alias->cleanup = !dev; if (dev) { if (dev != alias->dep.dev) { - if (alias->dep.dev) - device_remove_user(&alias->dep); + device_remove_user(&alias->dep); strcpy(alias->dev.ifname, dev->ifname); device_add_user(&alias->dep, dev); } @@ -396,6 +395,9 @@ void device_remove_user(struct device_user *dep) { struct device *dev = dep->dev; + if (!dep->dev) + return; + if (dep->claimed) device_release(dep); |