]> err.no Git - linux-2.6/commitdiff
[PATCH] rt2x00: make rt2x00lib_stop_link_tuner() reentrant with link_tuner work
authorIvo van Doorn <ivdoorn@gmail.com>
Tue, 25 Sep 2007 18:56:36 +0000 (20:56 +0200)
committerDavid S. Miller <davem@sunset.davemloft.net>
Wed, 10 Oct 2007 23:53:04 +0000 (16:53 -0700)
Calling cancel_delayed_work_sync() unconditionally won't hurt
and it will avoid race conditions when another CPU is already
executing link_tuner work.

Signed-off-by: Modestas Vainius <modestas@vainius.eu>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rt2x00/rt2x00dev.c

index f8f7e6e47f80e85c6fe672baac8c2de59d096aef..e8c91fb71a52de6bf3f3f95a7eed15ec0ceb5cee 100644 (file)
@@ -80,8 +80,7 @@ static void rt2x00lib_start_link_tuner(struct rt2x00_dev *rt2x00dev)
 
 static void rt2x00lib_stop_link_tuner(struct rt2x00_dev *rt2x00dev)
 {
-       if (delayed_work_pending(&rt2x00dev->link.work))
-               cancel_rearming_delayed_work(&rt2x00dev->link.work);
+       cancel_delayed_work_sync(&rt2x00dev->link.work);
 }
 
 void rt2x00lib_reset_link_tuner(struct rt2x00_dev *rt2x00dev)