V4L/DVB (10229): ivtv: fix memory leak

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
Hans Verkuil 2009-01-12 18:10:43 -03:00 committed by Mauro Carvalho Chehab
parent 2fd9c2eac3
commit 2c1a3c979c
1 changed files with 3 additions and 1 deletions

View File

@ -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),