Skip to content

Commit 9b8a9a3

Browse files
Uuuuuuhohdeller
authored andcommitted
fbdev: savage: fix probe-path EDID cleanup leaks
When CONFIG_FB_SAVAGE_I2C is enabled, savagefb_probe() can build both an EDID-derived monspecs.modedb and a modelist from it before later failing. The normal success path frees monspecs.modedb after the initial mode selection, but the probe error path only deletes the I2C busses and misses the EDID-derived allocations. Free both the modelist and monspecs.modedb on the failed: unwind path. Co-developed-by: Myeonghun Pak <mhun512@gmail.com> Signed-off-by: Myeonghun Pak <mhun512@gmail.com> Co-developed-by: Ijae Kim <ae878000@gmail.com> Signed-off-by: Ijae Kim <ae878000@gmail.com> Co-developed-by: Taegyu Kim <tmk5904@psu.edu> Signed-off-by: Taegyu Kim <tmk5904@psu.edu> Signed-off-by: Yuho Choi <dbgh9129@gmail.com> Signed-off-by: Helge Deller <deller@gmx.de>
1 parent 869b93b commit 9b8a9a3

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/video/fbdev/savage/savagefb_driver.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2322,6 +2322,8 @@ static int savagefb_probe(struct pci_dev *dev, const struct pci_device_id *id)
23222322
failed:
23232323
#ifdef CONFIG_FB_SAVAGE_I2C
23242324
savagefb_delete_i2c_busses(info);
2325+
fb_destroy_modelist(&info->modelist);
2326+
fb_destroy_modedb(info->monspecs.modedb);
23252327
#endif
23262328
fb_alloc_cmap(&info->cmap, 0, 0);
23272329
savage_unmap_video(info);

0 commit comments

Comments
 (0)