From: Hans Verkuil Date: Mon, 12 Jan 2009 21:10:43 +0000 (-0300) Subject: V4L/DVB (10229): ivtv: fix memory leak X-Git-Tag: firefly_0821_release~15674^2~2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=2c1a3c979ce66e3073c1b87373c0c01a95f847e6;p=firefly-linux-kernel-4.4.55.git V4L/DVB (10229): ivtv: fix memory leak Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/ivtv/ivtv-driver.c b/drivers/media/video/ivtv/ivtv-driver.c index e8e5921cdc34..c46c990987f9 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),