Re: [PATCH] firmware: sysfb: Clear the device pointer on registration failure

From: Javier Martinez Canillas

Date: Wed Nov 25 2026 - 03:42:17 EST


Yige Jiang <yigejiang86@xxxxxxxxx> writes:

Hello,

> sysfb_init() stores the legacy framebuffer device in the file-scope pd
> pointer before adding its data and registering it. If either operation
> fails, the error path drops the allocation reference but leaves pd set.
> A later sysfb_disable() then passes this stale pointer to
> platform_device_unregister().
>
> Clear pd after releasing the failed device, while disable_lock is still
> held. This makes sysfb_unregister() skip it just as it skips an absent
> or already unregistered framebuffer.
>
> Fixes: bde376e9de3c ("firmware: sysfb: Add sysfb_disable() helper function")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Yige Jiang <yigejiang86@xxxxxxxxx>
> ---

Thanks for the fix.

Reviewed-by: Javier Martinez Canillas <javierm@xxxxxxxxxx>

--
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat