Skip to content

Commit

Permalink
ledtrig-netdev: don't cancel work on events for different interfaces
Browse files Browse the repository at this point in the history
This fixes logic bug(in function netdev_trig_notify) introduced in
0b2991a 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>
  • Loading branch information
adron-s authored and nbd168 committed Jan 29, 2017
1 parent b8fcbbf commit ec095b5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions target/linux/generic/files/drivers/leds/ledtrig-netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ec095b5

Please sign in to comment.