Skip to content

Commit

Permalink
[PATCH] icn driver fails to unload when no hardware present
Browse files Browse the repository at this point in the history
Fix a null dereference in module unload path.

Found by a simple modprobe icn ; rmmod icn

Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Dave Jones authored and Linus Torvalds committed Aug 8, 2005
1 parent 92e52b2 commit 138b9dd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/isdn/icn/icn.c
Original file line number Diff line number Diff line change
Expand Up @@ -1650,7 +1650,7 @@ static void __exit icn_exit(void)
{
isdn_ctrl cmd;
icn_card *card = cards;
icn_card *last;
icn_card *last, *tmpcard;
int i;
unsigned long flags;

Expand All @@ -1670,8 +1670,9 @@ static void __exit icn_exit(void)
for (i = 0; i < ICN_BCH; i++)
icn_free_queue(card, i);
}
card = card->next;
tmpcard = card->next;
spin_unlock_irqrestore(&card->lock, flags);
card = tmpcard;
}
card = cards;
cards = NULL;
Expand Down

0 comments on commit 138b9dd

Please sign in to comment.