Re: [PATCH v2] fbdev: s3c-fb: Fix potential registration corruption on probe failure
From: Helge Deller
Date: Tue Nov 24 2026 - 16:55:46 EST
On 11/24/26 14:58, Guangshuo Li wrote:
s3c_fb_probe_win() publishes its window before registration succeeds.Thanks for cleaning up in v2!
On failure, the caller unregisters that unregistered framebuffer, whose
zero-initialized node can remove another framebuffer from registered_fb[0].
Colour-map allocation failure is also ignored.
Unwind failed windows inside s3c_fb_probe_win() and publish them only
after successful registration. Stop the window before freeing its display
memory if registration fails, and skip empty slots in the caller's cleanup.
This issue was found by our static analysis tool under development.
Fixes: ec549a0fdc32 ("fb: add s3c-fb driver for newer Samsung SoC framebuffer devices")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Guangshuo Li <liguangshuo@xxxxxxxxxxxxxxx>
---
Changes in v2:
- Unwind failed windows in s3c_fb_probe_win() and publish the window
only after registration succeeds, without a registration flag.
- Stop on colour-map allocation failure and skip empty cleanup slots.
- Blank the enabled window before freeing memory if registration fails.
drivers/video/fbdev/s3c-fb.c | 27 +++++++++++++++++++--------
1 file changed, 19 insertions(+), 8 deletions(-)
Patch is now applied to the fbdev git tree.
Thanks!
Helge