Skip to content

Commit 171cf94

Browse files
author
Russell King
committed
PCMCIA: fix sa1111 oops on remove
The sa1111 socket driver oopses when removed: Unable to handle kernel NULL pointer dereference at virtual address 000003b0 pgd = c1b40000 [000003b0] *pgd=00000000 Internal error: Oops: 41b43005 [raspberrypi#1] Modules linked in: CPU: 0 Not tainted (3.3.0-rc1+ raspberrypi#744) PC is at pcmcia_remove+0x3c/0x60 LR is at pcmcia_remove+0x34/0x60 This is because we try to dereference a NULL 's' to obtain the next pointer. Fix this. Signed-off-by: Russell King <[email protected]>
1 parent b3945bc commit 171cf94

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/pcmcia/sa1111_generic.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,8 @@ static int __devexit pcmcia_remove(struct sa1111_dev *dev)
205205

206206
dev_set_drvdata(&dev->dev, NULL);
207207

208-
for (; next = s->next, s; s = next) {
208+
for (; s; s = next) {
209+
next = s->next;
209210
soc_pcmcia_remove_one(&s->soc);
210211
kfree(s);
211212
}

0 commit comments

Comments
 (0)