* [patch] [media] cx231xx: dereferencing NULL after allocation failure
@ 2012-01-13 6:34 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2012-01-13 6:34 UTC (permalink / raw)
To: Mauro Carvalho Chehab
Cc: Devin Heitmueller, Thomas Petazzoni, Márcio A Alves,
linux-media, kernel-janitors
"dev" is NULL here so we should use "nr" instead of "dev->devno".
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/media/video/cx231xx/cx231xx-cards.c b/drivers/media/video/cx231xx/cx231xx-cards.c
index 919ed77..875a7ce 100644
--- a/drivers/media/video/cx231xx/cx231xx-cards.c
+++ b/drivers/media/video/cx231xx/cx231xx-cards.c
@@ -1052,7 +1052,7 @@ static int cx231xx_usb_probe(struct usb_interface *interface,
dev = kzalloc(sizeof(*dev), GFP_KERNEL);
if (dev = NULL) {
cx231xx_err(DRIVER_NAME ": out of memory!\n");
- clear_bit(dev->devno, &cx231xx_devused);
+ clear_bit(nr, &cx231xx_devused);
return -ENOMEM;
}
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2012-01-13 6:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-13 6:34 [patch] [media] cx231xx: dereferencing NULL after allocation failure Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).