From: Hugh Dickins Date: Fri, 10 Mar 2006 21:13:44 +0000 (+0000) Subject: [PATCH] fix pcmcia_device_probe oops X-Git-Tag: v2.6.16-rc6~29 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4ceadbf519c6820b236a9a213255260eb825974b;p=linux-2.6 [PATCH] fix pcmcia_device_probe oops Fix pcmcia_device_probe NULL pointer dereference at startup. Signed-off-by: Hugh Dickins Signed-off-by: Linus Torvalds --- diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c index 54ad93daca..bb96ce1db0 100644 --- a/drivers/pcmcia/ds.c +++ b/drivers/pcmcia/ds.c @@ -411,7 +411,7 @@ static int pcmcia_device_probe(struct device * dev) * pseudo devices, and if not, add the second one. */ 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 == 1) && (p_dev->device_no == 0)) pcmcia_add_pseudo_device(p_dev->socket);