diff options
author | Anton Vasilyev <[email protected]> | 2018-07-24 19:11:27 +0200 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <[email protected]> | 2018-07-24 19:11:27 +0200 |
commit | 5958fde72d04e7b8c6de3669d1f794a90997e3eb (patch) | |
tree | 82d572c4eb5d2b74f76f95a7659996a8c9ecde7e | |
parent | e32e2fe64a534ccd3ab8d9dbc5f7d5d302dfba50 (diff) |
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]>
-rw-r--r-- | drivers/video/fbdev/goldfishfb.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/video/fbdev/goldfishfb.c b/drivers/video/fbdev/goldfishfb.c index 3a9e5f1b758e..4377e3442638 100644 --- a/drivers/video/fbdev/goldfishfb.c +++ b/drivers/video/fbdev/goldfishfb.c @@ -304,6 +304,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; } |