[PATCH] video: fbdev: sm501fb: Fix deallocation of buffers order

Subsystems: framebuffer layer, the rest

STALE1941d

2 messages, 2 authors, 2021-04-20 · open the first message on its own page

[PATCH] video: fbdev: sm501fb: Fix deallocation of buffers order

From: Aditya Pakki <hidden>
Date: 2021-04-06 23:41:30

The resource release in sm501fb_remove() is not in the inverse order of
sm501fb_probe(), for the buffers. Release the info object after
deallocating the buffers.

Signed-off-by: Aditya Pakki <redacted>
---
 drivers/video/fbdev/sm501fb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/sm501fb.c b/drivers/video/fbdev/sm501fb.c
index 6a52eba64559..4c32c9e88850 100644
--- a/drivers/video/fbdev/sm501fb.c
+++ b/drivers/video/fbdev/sm501fb.c
@@ -2060,11 +2060,11 @@ static int sm501fb_remove(struct platform_device *pdev)
 		unregister_framebuffer(fbinfo_pnl);
 
 	sm501fb_stop(info);
-	kfree(info);
 
 	framebuffer_release(fbinfo_pnl);
 	framebuffer_release(fbinfo_crt);
 
+	kfree(info);
 	return 0;
 }
 
-- 
2.25.1

Re: [PATCH] video: fbdev: sm501fb: Fix deallocation of buffers order

From: Greg KH <gregkh@linuxfoundation.org>
Date: 2021-04-20 07:19:22

On Tue, Apr 06, 2021 at 06:35:17PM -0500, Aditya Pakki wrote:
quoted hunk
The resource release in sm501fb_remove() is not in the inverse order of
sm501fb_probe(), for the buffers. Release the info object after
deallocating the buffers.

Signed-off-by: Aditya Pakki <redacted>
---
 drivers/video/fbdev/sm501fb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/sm501fb.c b/drivers/video/fbdev/sm501fb.c
index 6a52eba64559..4c32c9e88850 100644
--- a/drivers/video/fbdev/sm501fb.c
+++ b/drivers/video/fbdev/sm501fb.c
@@ -2060,11 +2060,11 @@ static int sm501fb_remove(struct platform_device *pdev)
 		unregister_framebuffer(fbinfo_pnl);
 
 	sm501fb_stop(info);
-	kfree(info);
 
 	framebuffer_release(fbinfo_pnl);
 	framebuffer_release(fbinfo_crt);
 
+	kfree(info);
 	return 0;
 }
 
-- 
2.25.1
There is no function change here at all, please stop it with pointless
patches.

greg k-h
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help