[media] radio-maxiradio: fix memory leak when device is removed
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Fri, 3 Jun 2016 22:33:06 +0000 (19:33 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Tue, 28 Jun 2016 11:05:47 +0000 (08:05 -0300)
Memory allocated for maxiradio device is not deallocated when
the device is removed.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/radio/radio-maxiradio.c

index 70fd8e80198a5797895a5a7a60056307279bd795..8253f79d5d754fa383706293228d37d6f95ba8df 100644 (file)
@@ -183,6 +183,7 @@ static void maxiradio_remove(struct pci_dev *pdev)
        outb(0, dev->io);
        v4l2_device_unregister(v4l2_dev);
        release_region(pci_resource_start(pdev, 0), pci_resource_len(pdev, 0));
+       kfree(dev);
 }
 
 static struct pci_device_id maxiradio_pci_tbl[] = {