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: [email protected]
Signed-off-by: Abdun Nihaal <[email protected]>
---
 drivers/video/fbdev/tridentfb.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/video/fbdev/tridentfb.c b/drivers/video/fbdev/tridentfb.c
index a8fdbae83a80..9f055ba776c8 100644
--- a/drivers/video/fbdev/tridentfb.c
+++ b/drivers/video/fbdev/tridentfb.c
@@ -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);

-- 
2.43.0

Reply via email to