summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorFlorin Malita <fmalita@gmail.com>2007-10-13 16:49:52 +0200
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-10-22 16:01:36 +0200
commitfcf94c89af8acccb14ce37b1c9e8dd6bd32a999d (patch)
treea82d52ce361bd08f69db37c009766d0f039e090e /drivers/media
parentV4L/DVB (6324): fix videobuf_cgmbuf export (diff)
downloadlinux-fcf94c89af8acccb14ce37b1c9e8dd6bd32a999d.tar.xz
linux-fcf94c89af8acccb14ce37b1c9e8dd6bd32a999d.zip
V4L/DVB (6325): Double-free in cx23885_initdev
Both cx23885_initdev and cx23885_dev_setup free the device in their error path so a failure in the latter causes a double-free. Since cx23885_dev_setup is only called from cx23885_initdev, it should be safe to remove its deallocation and leave the cleanup up to the allocating function. Coverity CID 1922. Signed-off-by: Florin Malita <fmalita@gmail.com> CC: Steven Toth <stoth@hauppauge.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/cx23885/cx23885-core.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/media/video/cx23885/cx23885-core.c b/drivers/media/video/cx23885/cx23885-core.c
index af16505bd2e0..3cdd136477e5 100644
--- a/drivers/media/video/cx23885/cx23885-core.c
+++ b/drivers/media/video/cx23885/cx23885-core.c
@@ -793,7 +793,7 @@ static int cx23885_dev_setup(struct cx23885_dev *dev)
dev->pci->subsystem_device);
cx23885_devcount--;
- goto fail_free;
+ return -ENODEV;
}
/* PCIe stuff */
@@ -835,10 +835,6 @@ static int cx23885_dev_setup(struct cx23885_dev *dev)
}
return 0;
-
-fail_free:
- kfree(dev);
- return -ENODEV;
}
void cx23885_dev_unregister(struct cx23885_dev *dev)