summaryrefslogtreecommitdiff
path: root/drivers/media/video/cx231xx/cx231xx-cards.c
diff options
context:
space:
mode:
authorJesper Juhl <jj@chaosbits.net>2012-03-04 16:25:04 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-03-19 14:13:51 -0300
commit266e8ae37daa04fb3d89759305659f4e0acbc126 (patch)
treeabe4d6853750453d98050970cccc6352a06f83da /drivers/media/video/cx231xx/cx231xx-cards.c
parent1a611d8cd078e0059a4a596bcbed0bd8a915e2ef (diff)
[media] media, cx231xx: Fix double free on close
In cx231xx_v4l2_close() there are two calls to cx231xx_release_resources(dev) followed by kfree(dev). That is a problem since cx231xx_release_resources() already kfree()'s its argument, so we end up doing a double free. Easily resolved by just removing the redundant kfree() calls after the calls to cx231xx_release_resources(). I also changed the 'dev = NULL' assignments (which are rather pointless since 'dev' is about to go out of scope), to 'fh->dev = NULL' since it looks to me that that is what was actually intended. And I removed the 'dev = NULL' assignment at the end of cx231xx_release_resources() since it is pointless. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx231xx/cx231xx-cards.c')
-rw-r--r--drivers/media/video/cx231xx/cx231xx-cards.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/media/video/cx231xx/cx231xx-cards.c b/drivers/media/video/cx231xx/cx231xx-cards.c
index 875a7ce94736..8ed460d692e0 100644
--- a/drivers/media/video/cx231xx/cx231xx-cards.c
+++ b/drivers/media/video/cx231xx/cx231xx-cards.c
@@ -861,7 +861,6 @@ void cx231xx_release_resources(struct cx231xx *dev)
kfree(dev->sliced_cc_mode.alt_max_pkt_size);
kfree(dev->ts1_mode.alt_max_pkt_size);
kfree(dev);
- dev = NULL;
}
/*