Hi Helge,

Thanks for the review.

From: Helge Deller <[email protected]>
Date: 2026-11-19 02:17:08
To:  Guangshuo Li <[email protected]>,Jingoo Han 
<[email protected]>
Cc:  
[email protected],[email protected],[email protected],[email protected]
Subject: Re: [PATCH] fbdev: s3c-fb: Fix potential registration corruption on 
probe failure>On 11/18/26 15:22, Guangshuo Li wrote:
>> Probe failure cleanup calls unregister_framebuffer() even when the
>> window has not been registered. Its zero-initialized node can then
>> remove another framebuffer from registered_fb[0].
>> 
>> Track successful registration and only unregister those framebuffers.
>> Also skip empty window slots while unwinding a failed probe.
>> 
>> This issue was found by our static analysis tool under development.
>
>I think s3c_fb_probe_win() needs to clean up when some things
>like cmap fail to be allocated.
>Your patch seems to just work around one of the possible pitfalls.
>
>Helge
>

s3c_fb_probe_win() sets *res early and carries on if fb_alloc_cmap()
fails. I think it should unwind the current window on failure and set
*res only after register_framebuffer() succeeds. That would leave the
caller with just the registered windows to clean up.

Is that where you'd put the cleanup? If so, I'll send a v2 without
the extra registration flag.

Thanks,
Guangshuo

Reply via email to