Skip to content

Commit

Permalink
[PATCH] libertas: fix oops on rmmod
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Marcelo Tosatti authored and John W. Linville committed Jun 11, 2007
1 parent 0e37275 commit d43fb8e
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/net/wireless/libertas/if_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -970,15 +970,12 @@ static int if_usb_init_module(void)

static void if_usb_exit_module(void)
{
struct list_head *ptr;
struct usb_card_rec *cardp;
struct usb_card_rec *cardp, *cardp_temp;

lbs_deb_enter(LBS_DEB_MAIN);

list_for_each(ptr, &usb_devices) {
cardp = list_entry(ptr, struct usb_card_rec, list);
list_for_each_entry_safe(cardp, cardp_temp, &usb_devices, list)
if_usb_reset_device((wlan_private *) cardp->priv);
}

/* API unregisters the driver from USB subsystem */
usb_deregister(&if_usb_driver);
Expand Down

0 comments on commit d43fb8e

Please sign in to comment.