diff options
author | Julia Lawall <julia@diku.dk> | 2011-07-04 10:11:41 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-07-27 16:55:55 -0400 |
commit | ef60e8f5d58752879cc69d9746133f2416ac206a (patch) | |
tree | f850299d33f68ab84f8ccf53cf716b3158f2dca9 /drivers/media/video/cx231xx | |
parent | ee893e9adccd7dc22a6cfc5d4f49e7dd0baead0c (diff) |
[media] drivers/media/video/cx231xx/cx231xx-cards.c: add missing kfree
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:
// <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@diku.dk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx231xx')
-rw-r--r-- | drivers/media/video/cx231xx/cx231xx-cards.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/media/video/cx231xx/cx231xx-cards.c b/drivers/media/video/cx231xx/cx231xx-cards.c index 4b22afee18cf..9a07d3df3e20 100644 --- a/drivers/media/video/cx231xx/cx231xx-cards.c +++ b/drivers/media/video/cx231xx/cx231xx-cards.c | |||
@@ -1125,6 +1125,9 @@ static int cx231xx_usb_probe(struct usb_interface *interface, | |||
1125 | if (assoc_desc->bFirstInterface != ifnum) { | 1125 | if (assoc_desc->bFirstInterface != ifnum) { |
1126 | cx231xx_err(DRIVER_NAME ": Not found " | 1126 | cx231xx_err(DRIVER_NAME ": Not found " |
1127 | "matching IAD interface\n"); | 1127 | "matching IAD interface\n"); |
1128 | cx231xx_devused &= ~(1 << nr); | ||
1129 | kfree(dev); | ||
1130 | dev = NULL; | ||
1128 | return -ENODEV; | 1131 | return -ENODEV; |
1129 | } | 1132 | } |
1130 | 1133 | ||