summaryrefslogtreecommitdiffhomepage
path: root/device.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2013-10-03 15:10:33 +0200
committerFelix Fietkau <nbd@openwrt.org>2013-10-03 15:10:33 +0200
commit9c5fe49282cd15e81c8cf771aa271db10facc5b1 (patch)
treee47c391b4a16168abe5bfd6eb92774a76b4144d8 /device.c
parenta4fd42af1acf5019ad8ad198bd466e030ef06bd5 (diff)
device_add_user: return immediately if the new device is the same as the old device
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Diffstat (limited to 'device.c')
-rw-r--r--device.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/device.c b/device.c
index e635b05..53971c8 100644
--- a/device.c
+++ b/device.c
@@ -408,6 +408,9 @@ void device_add_user(struct device_user *dep, struct device *dev)
{
struct safe_list *head;
+ if (dep->dev == dev)
+ return;
+
if (dep->dev)
device_remove_user(dep);