* [PATCH] video: goldfishfb: fix memory leak on driver remove
@ 2018-07-06 12:04 ` Anton Vasilyev
2018-07-24 15:41 ` Bartlomiej Zolnierkiewicz
0 siblings, 1 reply; 2+ messages in thread
From: Anton Vasilyev @ 2018-07-06 12:04 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz
Cc: Anton Vasilyev, Aleksandar Markovic, Miodrag Dinic, Goran Ferenc,
dri-devel, linux-fbdev, linux-kernel, ldv-project
goldfish_fb_probe() allocates memory for fb, but goldfish_fb_remove() does
not have deallocation of fb, which leads to memory leak on probe/remove.
The patch adds deallocation into goldfish_fb_remove().
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Anton Vasilyev <vasilyev@ispras.ru>
---
drivers/video/fbdev/goldfishfb.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/video/fbdev/goldfishfb.c b/drivers/video/fbdev/goldfishfb.c
index 3b70044773b6..9fe7edf725c6 100644
--- a/drivers/video/fbdev/goldfishfb.c
+++ b/drivers/video/fbdev/goldfishfb.c
@@ -301,6 +301,7 @@ static int goldfish_fb_remove(struct platform_device *pdev)
dma_free_coherent(&pdev->dev, framesize, (void *)fb->fb.screen_base,
fb->fb.fix.smem_start);
iounmap(fb->reg_base);
+ kfree(fb);
return 0;
}
--
2.18.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] video: goldfishfb: fix memory leak on driver remove
2018-07-06 12:04 ` [PATCH] video: goldfishfb: fix memory leak on driver remove Anton Vasilyev
@ 2018-07-24 15:41 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 2+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2018-07-24 15:41 UTC (permalink / raw)
To: Anton Vasilyev
Cc: Aleksandar Markovic, Miodrag Dinic, Goran Ferenc, dri-devel,
linux-fbdev, linux-kernel, ldv-project
On Friday, July 06, 2018 03:04:22 PM Anton Vasilyev wrote:
> goldfish_fb_probe() allocates memory for fb, but goldfish_fb_remove() does
> not have deallocation of fb, which leads to memory leak on probe/remove.
>
> The patch adds deallocation into goldfish_fb_remove().
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
> Signed-off-by: Anton Vasilyev <vasilyev@ispras.ru>
Patch queued for 4.19, thanks.
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-07-24 15:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <CGME20180706120501epcas5p3a2db5a74c3b4b0d2c8e102fbe3943de6@epcas5p3.samsung.com>
2018-07-06 12:04 ` [PATCH] video: goldfishfb: fix memory leak on driver remove Anton Vasilyev
2018-07-24 15:41 ` Bartlomiej Zolnierkiewicz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).