diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-01-24 16:33:26 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-01-24 16:33:26 -0500 |
commit | 171cf94ccb4b476d1d7d694a31d0820558375132 (patch) | |
tree | a7874cd87511ee26ea3ee07d15706ac51746777e /drivers/pcmcia | |
parent | b3945bcbc3f9856f4b5452079bfc2b9738040a37 (diff) |
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 [#1]
Modules linked in:
CPU: 0 Not tainted (3.3.0-rc1+ #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 <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/pcmcia')
-rw-r--r-- | drivers/pcmcia/sa1111_generic.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/pcmcia/sa1111_generic.c b/drivers/pcmcia/sa1111_generic.c index 59866905ea37..27f2fe3b7fb4 100644 --- a/drivers/pcmcia/sa1111_generic.c +++ b/drivers/pcmcia/sa1111_generic.c | |||
@@ -205,7 +205,8 @@ static int __devexit pcmcia_remove(struct sa1111_dev *dev) | |||
205 | 205 | ||
206 | dev_set_drvdata(&dev->dev, NULL); | 206 | dev_set_drvdata(&dev->dev, NULL); |
207 | 207 | ||
208 | for (; next = s->next, s; s = next) { | 208 | for (; s; s = next) { |
209 | next = s->next; | ||
209 | soc_pcmcia_remove_one(&s->soc); | 210 | soc_pcmcia_remove_one(&s->soc); |
210 | kfree(s); | 211 | kfree(s); |
211 | } | 212 | } |