]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
fbdev: tridentfb: fix potential memory leak in trident_pci_probe()
authorAbdun Nihaal <nihaal@cse.iitm.ac.in>
Thu, 14 May 2026 08:24:39 +0000 (13:54 +0530)
committerHelge Deller <deller@gmx.de>
Sun, 7 Jun 2026 16:25:42 +0000 (18:25 +0200)
In trident_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: 6a5e3bd0c8bc ("tridentfb: 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/tridentfb.c

index a8fdbae83a8055a83ec90d758bcd06d4e7972e61..9f055ba776c81ae707f8adbb777ffdeaf10f11ea 100644 (file)
@@ -1706,6 +1706,7 @@ static int trident_pci_probe(struct pci_dev *dev,
        return 0;
 
 out_unmap2:
+       fb_destroy_modelist(&info->modelist);
        if (default_par->ddc_registered)
                i2c_del_adapter(&default_par->ddc_adapter);
        kfree(info->pixmap.addr);