mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] fbdev: uvesafb: unregister connector callback on init failure
@ 2026-07-01 11:12 Myeonghun Pak
  2026-07-18 18:40 ` Helge Deller
  0 siblings, 1 reply; 2+ messages in thread
From: Myeonghun Pak @ 2026-07-01 11:12 UTC (permalink / raw)
  To: Michal Januszewski, Helge Deller
  Cc: linux-fbdev, dri-devel, linux-kernel, stable, Myeonghun Pak, Ijae Kim

uvesafb_init() registers the v86d connector callback before registering
the platform driver. If platform_driver_register() fails, the function
returns the error directly and leaves the connector callback registered.

The later platform-device failure path already unregisters the callback.
Add the same cleanup before the final return when platform-driver
registration fails.

This issue was identified during our ongoing static-analysis research while
reviewing kernel code.

Fixes: 8bdb3a2d7df4 ("uvesafb: the driver core")
Cc: stable@vger.kernel.org
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
---
 drivers/video/fbdev/uvesafb.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/video/fbdev/uvesafb.c b/drivers/video/fbdev/uvesafb.c
index 9d82326c744f..ccc9dbc25813 100644
--- a/drivers/video/fbdev/uvesafb.c
+++ b/drivers/video/fbdev/uvesafb.c
@@ -1907,6 +1907,8 @@ static int uvesafb_init(void)
 			err = 0;
 		}
 	}
+	if (err)
+		cn_del_callback(&uvesafb_cn_id);
 	return err;
 }
 
-- 
2.47.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] fbdev: uvesafb: unregister connector callback on init failure
  2026-07-01 11:12 [PATCH] fbdev: uvesafb: unregister connector callback on init failure Myeonghun Pak
@ 2026-07-18 18:40 ` Helge Deller
  0 siblings, 0 replies; 2+ messages in thread
From: Helge Deller @ 2026-07-18 18:40 UTC (permalink / raw)
  To: Myeonghun Pak, Michal Januszewski
  Cc: linux-fbdev, dri-devel, linux-kernel, stable, Ijae Kim

On 7/1/26 13:12, Myeonghun Pak wrote:
> uvesafb_init() registers the v86d connector callback before registering
> the platform driver. If platform_driver_register() fails, the function
> returns the error directly and leaves the connector callback registered.
> 
> The later platform-device failure path already unregisters the callback.
> Add the same cleanup before the final return when platform-driver
> registration fails.
> 
> This issue was identified during our ongoing static-analysis research while
> reviewing kernel code.
> 
> Fixes: 8bdb3a2d7df4 ("uvesafb: the driver core")
> Cc: stable@vger.kernel.org
> Co-developed-by: Ijae Kim <ae878000@gmail.com>
> Signed-off-by: Ijae Kim <ae878000@gmail.com>
> Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
> ---
>   drivers/video/fbdev/uvesafb.c | 2 ++
>   1 file changed, 2 insertions(+)
applied.

Thanks!
Helge

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-07-18 18:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-01 11:12 [PATCH] fbdev: uvesafb: unregister connector callback on init failure Myeonghun Pak
2026-07-18 18:40 ` Helge Deller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®