Commit 3da7429c authored by Larry Finger's avatar Larry Finger Committed by John W. Linville
Browse files

rtl8187: Fix for kernel oops when unloading with LEDs enabled

When rtl8187 is unloaded and CONFIG_RTL8187_LEDS is set, the kernel
may oops when the module is unloaded as the workqueue for led_on was
not being cancelled.

This patch fixes the problem reported in
http://marc.info/?l=linux-wireless&m=124742957615781&w=2

.

Reported-by: default avatarGábor Stefanik <netrolller.3d@gmail.com>
Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 65b5a698
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -208,11 +208,12 @@ void rtl8187_leds_exit(struct ieee80211_hw *dev)
{
	struct rtl8187_priv *priv = dev->priv;

	rtl8187_unregister_led(&priv->led_tx);
	/* turn the LED off before exiting */
	queue_delayed_work(dev->workqueue, &priv->led_off, 0);
	cancel_delayed_work_sync(&priv->led_off);
	cancel_delayed_work_sync(&priv->led_on);
	rtl8187_unregister_led(&priv->led_rx);
	rtl8187_unregister_led(&priv->led_tx);
}
#endif /* def CONFIG_RTL8187_LED */