aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMarcin Slusarz <marcin.slusarz@gmail.com>2009-03-13 18:41:19 -0400
committerDavid S. Miller <davem@davemloft.net>2009-03-13 18:41:19 -0400
commita390d1f379cf821248b735f43d2e1147ebb8241d (patch)
tree8011cb8a5056055bedb4a9f4948929e2543a727d /include
parent34cd347cec6dba8075ceca06efd4fb0c6574cb75 (diff)
phylib: convert state_queue work to delayed_work
It closes a race in phy_stop_machine when reprogramming of phy_timer (from phy_state_machine) happens between del_timer_sync and cancel_work_sync. Without this change it could lead to crash if phy_device would be freed after phy_stop_machine (timer would fire and schedule freed work). Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/phy.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/include/linux/phy.h b/include/linux/phy.h
index d7e54d98869f..32cf14a4b034 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -315,8 +315,7 @@ struct phy_device {
315 315
316 /* Interrupt and Polling infrastructure */ 316 /* Interrupt and Polling infrastructure */
317 struct work_struct phy_queue; 317 struct work_struct phy_queue;
318 struct work_struct state_queue; 318 struct delayed_work state_queue;
319 struct timer_list phy_timer;
320 atomic_t irq_disable; 319 atomic_t irq_disable;
321 320
322 struct mutex lock; 321 struct mutex lock;