]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
fbdev: s3fb: fix potential memory leak in s3_pci_probe()
authorAbdun Nihaal <nihaal@cse.iitm.ac.in>
Thu, 14 May 2026 08:24:37 +0000 (13:54 +0530)
committerHelge Deller <deller@gmx.de>
Sun, 7 Jun 2026 16:25:42 +0000 (18:25 +0200)
In s3_pci_probe(), the memory allocated for modelist using
fb_videomode_to_modelist() is not freed in subsequent error paths.
Fix that by calling fb_destroy_modelist()

Fixes: 86c0f043a737 ("s3fb: add DDC support")
Cc: stable@vger.kernel.org
Signed-off-by: Abdun Nihaal <nihaal@cse.iitm.ac.in>
Signed-off-by: Helge Deller <deller@gmx.de>
drivers/video/fbdev/s3fb.c

index 831e9e6861b1b5e8bac549488457af71b7d16e5e..dc1f9b627185d311fb7c387665e324dd4e38bdbd 100644 (file)
@@ -1446,6 +1446,7 @@ err_reg_fb:
 err_alloc_cmap:
 err_find_mode:
 #ifdef CONFIG_FB_S3_DDC
+       fb_destroy_modelist(&info->modelist);
        if (par->ddc_registered)
                i2c_del_adapter(&par->ddc_adapter);
        if (par->mmio)