mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] fix pcmcia_device_probe oops
@ 2006-03-10 21:13 Hugh Dickins
  0 siblings, 0 replies; only message in thread
From: Hugh Dickins @ 2006-03-10 21:13 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Andrew Morton, Dominik Brodowski, linux-kernel

Fix pcmcia_device_probe NULL pointer dereference at startup.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
---
This oops was in -mm for a long time, sorry, I never got around to
investigating it then; but now it has graduated to mainline -rc5-git.
It may well be a consequence of my ignoring pcmcia's "please expect
breakage unless you upgrade to new tools" - but I think this is not a
permissible kind of breakage, and my cards work as before with the fix.

 drivers/pcmcia/ds.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

--- 2.6.16-rc5-git14/drivers/pcmcia/ds.c	2006-03-10 10:07:30.000000000 +0000
+++ linux/drivers/pcmcia/ds.c	2006-03-10 17:16:27.000000000 +0000
@@ -411,7 +411,7 @@ static int pcmcia_device_probe(struct de
 	 * 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);
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-03-10 21:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-10 21:13 [PATCH] fix pcmcia_device_probe oops Hugh Dickins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®