diff options
author | Julia Lawall <julia@diku.dk> | 2011-07-04 11:11:42 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-07-27 17:55:55 -0300 |
commit | ee893e9adccd7dc22a6cfc5d4f49e7dd0baead0c (patch) | |
tree | 5df6b9ceba36687c3e999089d8b6a93fd45d2f0a | |
parent | 37f9619dd5df9f1c9878ac53e27033519b8760ec (diff) |
[media] drivers/media/video: add missing kfree
Free the recently allocated qcam in each case.
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>
-rw-r--r-- | drivers/media/video/bw-qcam.c | 1 | ||||
-rw-r--r-- | drivers/media/video/c-qcam.c | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/drivers/media/video/bw-qcam.c b/drivers/media/video/bw-qcam.c index 2fc998e9b2f7..f09df9dffaae 100644 --- a/drivers/media/video/bw-qcam.c +++ b/drivers/media/video/bw-qcam.c @@ -893,6 +893,7 @@ static struct qcam *qcam_init(struct parport *port) if (v4l2_device_register(NULL, v4l2_dev) < 0) { v4l2_err(v4l2_dev, "Could not register v4l2_device\n"); + kfree(qcam); return NULL; } diff --git a/drivers/media/video/c-qcam.c b/drivers/media/video/c-qcam.c index b8d800e60056..cd8ff0473184 100644 --- a/drivers/media/video/c-qcam.c +++ b/drivers/media/video/c-qcam.c @@ -750,6 +750,7 @@ static struct qcam *qcam_init(struct parport *port) if (v4l2_device_register(NULL, v4l2_dev) < 0) { v4l2_err(v4l2_dev, "Could not register v4l2_device\n"); + kfree(qcam); return NULL; } |