Skip to content

Commit 5958fde

Browse files
Druidosbzolnier
authored andcommitted
video: goldfishfb: fix memory leak on driver remove
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 <[email protected]> Cc: Aleksandar Markovic <[email protected]> Cc: Miodrag Dinic <[email protected]> Cc: Goran Ferenc <[email protected]> Signed-off-by: Bartlomiej Zolnierkiewicz <[email protected]>
1 parent e32e2fe commit 5958fde

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/video/fbdev/goldfishfb.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ static int goldfish_fb_remove(struct platform_device *pdev)
304304
dma_free_coherent(&pdev->dev, framesize, (void *)fb->fb.screen_base,
305305
fb->fb.fix.smem_start);
306306
iounmap(fb->reg_base);
307+
kfree(fb);
307308
return 0;
308309
}
309310

0 commit comments

Comments
 (0)