[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1309788705-22278-1-git-send-email-julia@diku.dk>
Date: Mon, 4 Jul 2011 16:11:41 +0200
From: Julia Lawall <julia@...u.dk>
To: Mauro Carvalho Chehab <mchehab@...radead.org>
Cc: kernel-janitors@...r.kernel.org,
Devin Heitmueller <dheitmueller@...ppauge.com>,
Sri Devi <Srinivasa.Deevi@...exant.com>,
Jarod Wilson <jarod@...hat.com>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
linux-media@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 1/5] drivers/media/video/cx231xx/cx231xx-cards.c: add missing kfree
From: Julia Lawall <julia@...u.dk>
Clear the cx231xx_devused variable and free dev in the error handling code,
as done in the error handling code nearby.
The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@r@
identifier x;
@@
kfree(x)
@@
identifier r.x;
expression E1!=0,E2,E3,E4;
statement S;
@@
(
if (<+...x...+>) S
|
if (...) { ... when != kfree(x)
when != if (...) { ... kfree(x); ... }
when != x = E3
* return E1;
}
... when != x = E2
if (...) { ... when != x = E4
kfree(x); ... return ...; }
)
// </smpl>
Signed-off-by: Julia Lawall <julia@...u.dk>
---
drivers/media/video/cx231xx/cx231xx-cards.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/media/video/cx231xx/cx231xx-cards.c b/drivers/media/video/cx231xx/cx231xx-cards.c
index 2270381..c46dca9 100644
--- a/drivers/media/video/cx231xx/cx231xx-cards.c
+++ b/drivers/media/video/cx231xx/cx231xx-cards.c
@@ -1051,6 +1051,9 @@ static int cx231xx_usb_probe(struct usb_interface *interface,
if (assoc_desc->bFirstInterface != ifnum) {
cx231xx_err(DRIVER_NAME ": Not found "
"matching IAD interface\n");
+ cx231xx_devused &= ~(1 << nr);
+ kfree(dev);
+ dev = NULL;
return -ENODEV;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists