From: Felix Fietkau Date: Thu, 3 Oct 2013 13:10:33 +0000 (+0200) Subject: device_add_user: return immediately if the new device is the same as the old device X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fnetifd.git;a=commitdiff_plain;h=9c5fe49282cd15e81c8cf771aa271db10facc5b1 device_add_user: return immediately if the new device is the same as the old device Signed-off-by: Felix Fietkau --- 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);