ledtrig-netdev: don't cancel work on events for different interfaces
[openwrt/openwrt.git] / target / linux / generic / files / drivers / leds / ledtrig-netdev.c
index 2181a262509c9f37b321db52904485e76860d666..7246bcaf7e7b91029fa00bc25d8130a1ae95a043 100644 (file)
@@ -267,13 +267,13 @@ static int netdev_trig_notify(struct notifier_block *nb,
        if (evt != NETDEV_UP && evt != NETDEV_DOWN && evt != NETDEV_CHANGE && evt != NETDEV_REGISTER && evt != NETDEV_UNREGISTER && evt != NETDEV_CHANGENAME)
                return NOTIFY_DONE;
 
+       if (strcmp(dev->name, trigger_data->device_name))
+               return NOTIFY_DONE;
+
        cancel_delayed_work_sync(&trigger_data->work);
 
        spin_lock_bh(&trigger_data->lock);
 
-       if (strcmp(dev->name, trigger_data->device_name))
-               goto done;
-
        if (evt == NETDEV_REGISTER || evt == NETDEV_CHANGENAME) {
                if (trigger_data->net_dev != NULL)
                        dev_put(trigger_data->net_dev);