summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2009-01-12 18:10:43 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-01-29 09:19:29 -0200
commit2c1a3c979ce66e3073c1b87373c0c01a95f847e6 (patch)
tree1b066d1959d44bae63477c0af936cbd5072afad8 /drivers/media
parent2fd9c2eac31d8b3c1b719c7dfbbfed17c5cbccc4 (diff)
downloadop-kernel-dev-2c1a3c979ce66e3073c1b87373c0c01a95f847e6.zip
op-kernel-dev-2c1a3c979ce66e3073c1b87373c0c01a95f847e6.tar.gz
V4L/DVB (10229): ivtv: fix memory leak
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/ivtv/ivtv-driver.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/video/ivtv/ivtv-driver.c b/drivers/media/video/ivtv/ivtv-driver.c
index e8e5921..c46c990 100644
--- a/drivers/media/video/ivtv/ivtv-driver.c
+++ b/drivers/media/video/ivtv/ivtv-driver.c
@@ -949,8 +949,10 @@ static int __devinit ivtv_probe(struct pci_dev *dev,
itv->instance = atomic_inc_return(&ivtv_instance) - 1;
retval = v4l2_device_register(&dev->dev, &itv->device);
- if (retval)
+ if (retval) {
+ kfree(itv);
return retval;
+ }
/* "ivtv + PCI ID" is a bit of a mouthful, so use
"ivtv + instance" instead. */
snprintf(itv->device.name, sizeof(itv->device.name),
OpenPOWER on IntegriCloud