Skip to content

Commit

Permalink
mac802154: iface: fix hrtimer cancel on ifdown
Browse files Browse the repository at this point in the history
The interframe spacing timer is a per phy definition and is part of a
ieee802154_local structure. If we have possible multiple interfaces
ifdown one interface then the timer should not be cancled. First if the
last interface is down and the receive handling is stopped we should be
sure that the interframe spacing timer isn't run anymore.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
  • Loading branch information
alexaring authored and holtmann committed Jun 14, 2015
1 parent 1bc1754 commit b4ee194
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions net/mac802154/iface.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,15 +302,15 @@ static int mac802154_slave_close(struct net_device *dev)

ASSERT_RTNL();

hrtimer_cancel(&local->ifs_timer);

netif_stop_queue(dev);
local->open_count--;

clear_bit(SDATA_STATE_RUNNING, &sdata->state);

if (!local->open_count)
if (!local->open_count) {
hrtimer_cancel(&local->ifs_timer);
drv_stop(local);
}

return 0;
}
Expand Down

0 comments on commit b4ee194

Please sign in to comment.