summaryrefslogtreecommitdiff
path: root/target/linux
diff options
context:
space:
mode:
authorSergey Sergeev <adron@yapic.net>2017-01-29 19:01:40 +0300
committerFelix Fietkau <nbd@nbd.name>2017-01-29 17:34:29 +0100
commitec095b5bf3bf0e6c570232522004c17084ba909d (patch)
treeb106f408f6beb1ed8659090b156f214f888f33c4 /target/linux
parentb8fcbbf31dd0005628d0dd738eab57de70d0de6e (diff)
downloadmtk-20170518-ec095b5bf3bf0e6c570232522004c17084ba909d.zip
mtk-20170518-ec095b5bf3bf0e6c570232522004c17084ba909d.tar.gz
mtk-20170518-ec095b5bf3bf0e6c570232522004c17084ba909d.tar.bz2
ledtrig-netdev: don't cancel work on events for different interfaces
This fixes logic bug(in function netdev_trig_notify) introduced in 0b2991a8ed32b5d9ba0a7c3441a72e1c1a1c4fde commit. Events triggered by different interfaces were stopping work queue so it wasn't working for tx/rx mode. Signed-off-by: Sergey Sergeev <adron@yapic.net>
Diffstat (limited to 'target/linux')
-rw-r--r--target/linux/generic/files/drivers/leds/ledtrig-netdev.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/target/linux/generic/files/drivers/leds/ledtrig-netdev.c b/target/linux/generic/files/drivers/leds/ledtrig-netdev.c
index 2181a26..7246bca 100644
--- a/target/linux/generic/files/drivers/leds/ledtrig-netdev.c
+++ b/target/linux/generic/files/drivers/leds/ledtrig-netdev.c
@@ -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);