ledtrig-netdev: don't stop timer on events for different interfaces
authorRafał Miłecki <zajec5@gmail.com>
Sat, 2 Jan 2016 22:15:40 +0000 (22:15 +0000)
committerRafał Miłecki <zajec5@gmail.com>
Sat, 2 Jan 2016 22:15:40 +0000 (22:15 +0000)
This fixes regression introduced in my recent ledtrig-netdev commit.
Events triggered by different interfaces were stopping timer so it
wasn't working for tx/rx mode.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Backport of r48072

SVN-Revision: 48074

target/linux/generic/files/drivers/leds/ledtrig-netdev.c

index 5d0f95499b702ca78546f9c55445deee4e972537..cfa4dc0758dcc37224a08ef726b7225dbb55822b 100644 (file)
@@ -269,11 +269,12 @@ static int netdev_trig_notify(struct notifier_block *nb,
                return NOTIFY_DONE;
 
        spin_lock_bh(&trigger_data->lock);
-       del_timer_sync(&trigger_data->timer);
 
        if (strcmp(dev->name, trigger_data->device_name))
                goto done;
 
+       del_timer_sync(&trigger_data->timer);
+
        if (evt == NETDEV_REGISTER || evt == NETDEV_CHANGENAME) {
                if (trigger_data->net_dev != NULL)
                        dev_put(trigger_data->net_dev);