Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 138b9dd1 authored by Dave Jones's avatar Dave Jones Committed by Linus Torvalds
Browse files

[PATCH] icn driver fails to unload when no hardware present



Fix a null dereference in module unload path.

Found by a simple modprobe icn ; rmmod icn

Signed-off-by: default avatarDave Jones <davej@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 92e52b2e
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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;

@@ -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;