diff options
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); |