Commit 9b8a9a3a authored by Yuho Choi's avatar Yuho Choi Committed by Helge Deller
Browse files

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: default avatarMyeonghun Pak <mhun512@gmail.com>
Signed-off-by: default avatarMyeonghun Pak <mhun512@gmail.com>
Co-developed-by: default avatarIjae Kim <ae878000@gmail.com>
Signed-off-by: default avatarIjae Kim <ae878000@gmail.com>
Co-developed-by: default avatarTaegyu Kim <tmk5904@psu.edu>
Signed-off-by: default avatarTaegyu Kim <tmk5904@psu.edu>
Signed-off-by: default avatarYuho Choi <dbgh9129@gmail.com>
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
parent 869b93ba
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -2322,6 +2322,8 @@ static int savagefb_probe(struct pci_dev *dev, const struct pci_device_id *id)
 failed:
#ifdef CONFIG_FB_SAVAGE_I2C
	savagefb_delete_i2c_busses(info);
	fb_destroy_modelist(&info->modelist);
	fb_destroy_modedb(info->monspecs.modedb);
#endif
	fb_alloc_cmap(&info->cmap, 0, 0);
	savage_unmap_video(info);