From: Alexey Khoroshilov Date: Fri, 3 Jun 2016 22:33:06 +0000 (-0300) Subject: [media] radio-maxiradio: fix memory leak when device is removed X-Git-Tag: v4.8~408^2~222 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=04bc936591469433b6ad3b16b04e07cb1b86690a;p=platform%2Fkernel%2Flinux-amlogic.git [media] radio-maxiradio: fix memory leak when device is removed 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 Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/radio/radio-maxiradio.c b/drivers/media/radio/radio-maxiradio.c index 70fd8e8..8253f79 100644 --- a/drivers/media/radio/radio-maxiradio.c +++ b/drivers/media/radio/radio-maxiradio.c @@ -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[] = {