Commit d43fb8ee authored by Marcelo Tosatti's avatar Marcelo Tosatti Committed by John W. Linville

[PATCH] libertas: fix oops on rmmod

Use list_for_each_entry_safe, to protect against list_del().
Signed-off-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 0e37275e
...@@ -970,15 +970,12 @@ static int if_usb_init_module(void) ...@@ -970,15 +970,12 @@ static int if_usb_init_module(void)
static void if_usb_exit_module(void) static void if_usb_exit_module(void)
{ {
struct list_head *ptr; struct usb_card_rec *cardp, *cardp_temp;
struct usb_card_rec *cardp;
lbs_deb_enter(LBS_DEB_MAIN); lbs_deb_enter(LBS_DEB_MAIN);
list_for_each(ptr, &usb_devices) { list_for_each_entry_safe(cardp, cardp_temp, &usb_devices, list)
cardp = list_entry(ptr, struct usb_card_rec, list);
if_usb_reset_device((wlan_private *) cardp->priv); if_usb_reset_device((wlan_private *) cardp->priv);
}
/* API unregisters the driver from USB subsystem */ /* API unregisters the driver from USB subsystem */
usb_deregister(&if_usb_driver); usb_deregister(&if_usb_driver);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment