[PATCH] fbdev: kyro: Release framebuffer state from the destroy callback
From: Shuo Qin
Date: Sat Dec 05 2026 - 04:55:30 EST
An open framebuffer file keeps a reference to fb_info after the device
is unregistered. kyrofb_remove() nevertheless calls framebuffer_release()
immediately after unregister_framebuffer(). When a file is still open,
framebuffer_release() warns and returns without freeing the allocation.
The final put_fb_info() cannot free it either because fb_destroy is unset.
Set fb_destroy to framebuffer_release() and let the framebuffer core
release the allocation after the final reference is dropped. Keep direct
release in the probe error paths, before the framebuffer is registered.
Co-developed-by: Bin Yu <byu@xxxxxxxxxxxxx>
Signed-off-by: Bin Yu <byu@xxxxxxxxxxxxx>
Co-developed-by: Cheng Wen <wencheng@xxxxxxxxxxxxx>
Signed-off-by: Cheng Wen <wencheng@xxxxxxxxxxxxx>
Signed-off-by: Shuo Qin <23159100078@xxxxxxxxxxxxxxxxx>
---
drivers/video/fbdev/kyro/fbdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/kyro/fbdev.c b/drivers/video/fbdev/kyro/fbdev.c
index 94d6af54e6c461d7ca0183e0a22f37c17f0167ca..3729bdae2a6a5b74d7ce34e302793d2a4377c34d 100644
--- a/drivers/video/fbdev/kyro/fbdev.c
+++ b/drivers/video/fbdev/kyro/fbdev.c
@@ -687,6 +687,7 @@ static const struct fb_ops kyrofb_ops = {
.fb_set_par = kyrofb_set_par,
.fb_setcolreg = kyrofb_setcolreg,
.fb_ioctl = kyrofb_ioctl,
+ .fb_destroy = framebuffer_release,
};
static int kyrofb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
@@ -802,7 +803,6 @@ static void kyrofb_remove(struct pci_dev *pdev)
arch_phys_wc_del(par->wc_cookie);
unregister_framebuffer(info);
- framebuffer_release(info);
}
static int __init kyrofb_init(void)
--
2.34.1