diff options
author | Marcelo Tosatti <mtosatti@redhat.com> | 2007-05-25 16:28:20 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2007-06-11 14:28:42 -0400 |
commit | d43fb8ee3dab261e475d4f5189cf86182139b7f4 (patch) | |
tree | 5fb03e34b001f3b0506ddf07ac640a9643787ced /drivers/net/wireless | |
parent | 0e37275e9af07be6aa796b3ee981054525980b74 (diff) |
[PATCH] libertas: fix oops on rmmod
Use list_for_each_entry_safe, to protect against list_del().
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/libertas/if_usb.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c index 10698a1c1c30..de7a2e2babe6 100644 --- a/drivers/net/wireless/libertas/if_usb.c +++ b/drivers/net/wireless/libertas/if_usb.c | |||
@@ -970,15 +970,12 @@ static int if_usb_init_module(void) | |||
970 | 970 | ||
971 | static void if_usb_exit_module(void) | 971 | static void if_usb_exit_module(void) |
972 | { | 972 | { |
973 | struct list_head *ptr; | 973 | struct usb_card_rec *cardp, *cardp_temp; |
974 | struct usb_card_rec *cardp; | ||
975 | 974 | ||
976 | lbs_deb_enter(LBS_DEB_MAIN); | 975 | lbs_deb_enter(LBS_DEB_MAIN); |
977 | 976 | ||
978 | list_for_each(ptr, &usb_devices) { | 977 | list_for_each_entry_safe(cardp, cardp_temp, &usb_devices, list) |
979 | cardp = list_entry(ptr, struct usb_card_rec, list); | ||
980 | if_usb_reset_device((wlan_private *) cardp->priv); | 978 | if_usb_reset_device((wlan_private *) cardp->priv); |
981 | } | ||
982 | 979 | ||
983 | /* API unregisters the driver from USB subsystem */ | 980 | /* API unregisters the driver from USB subsystem */ |
984 | usb_deregister(&if_usb_driver); | 981 | usb_deregister(&if_usb_driver); |