From: Hugh Dickins Fix pcmcia_device_remove NULL pointer dereference at shutdown. Signed-off-by: Hugh Dickins Cc: Dominik Brodowski Signed-off-by: Andrew Morton --- drivers/pcmcia/ds.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) diff -puN drivers/pcmcia/ds.c~fix-pcmcia_device_remove-oops drivers/pcmcia/ds.c --- 25/drivers/pcmcia/ds.c~fix-pcmcia_device_remove-oops Fri Mar 10 16:07:12 2006 +++ 25-akpm/drivers/pcmcia/ds.c Fri Mar 10 16:07:12 2006 @@ -464,7 +464,7 @@ static int pcmcia_device_remove(struct d * all devices */ did = (struct pcmcia_device_id *) p_dev->dev.driver_data; - if ((did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) && + if (did && (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) && (p_dev->socket->device_count != 0) && (p_dev->device_no == 0)) pcmcia_card_remove(p_dev->socket, p_dev); _