Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1413549 > unrolled thread

[PATCH] [media] radio-maxiradio: fix memory leak when device is removed

Started byAlexey Khoroshilov <khoroshilov@ispras.ru>
First post2016-06-04 00:40 +0200
Last post2016-06-04 00:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] [media] radio-maxiradio: fix memory leak when device is removed Alexey Khoroshilov <khoroshilov@ispras.ru> - 2016-06-04 00:40 +0200

#1413549 — [PATCH] [media] radio-maxiradio: fix memory leak when device is removed

FromAlexey Khoroshilov <khoroshilov@ispras.ru>
Date2016-06-04 00:40 +0200
Subject[PATCH] [media] radio-maxiradio: fix memory leak when device is removed
Message-ID<rG5UZ-Ei-9@gated-at.bofh.it>
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>
---
 drivers/media/radio/radio-maxiradio.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/radio/radio-maxiradio.c b/drivers/media/radio/radio-maxiradio.c
index 70fd8e80198a..8253f79d5d75 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[] = {
-- 
1.9.1

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web