Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH 00/14] fbdev: fix various memory leaks
@ 2026-05-14  8:24 Abdun Nihaal
  2026-05-14  8:24 ` [PATCH 01/14] fbdev: hecubafb: fix potential memory leak in hecubafb_probe() Abdun Nihaal
                   ` (13 more replies)
  0 siblings, 14 replies; 20+ messages in thread
From: Abdun Nihaal @ 2026-05-14  8:24 UTC (permalink / raw)
  To: Helge Deller, Javier Martinez Canillas, Thomas Zimmermann,
	Benjamin Herrenschmidt, Andrew Morton, Sebastian Siewior,
	Florian Tobias Schandinat, Ondrej Zary, Antonino Daplas,
	Paul Mundt, Krzysztof Helt, Tomi Valkeinen, Michal Januszewski,
	Heiko Schocher, Peter Jones
  Cc: linux-fbdev, dri-devel, linux-kernel, stable, Abdun Nihaal

This patchset fixes some memory leak issues present in fbdev drivers.

Since commit 56c134f7f1b5 ("fbdev: Track deferred-I/O pages in pageref struct")
fb_deferred_io_init() allocated memory for pagerefs and returned an
error code, but the existing drivers which call fb_deferred_io_init()
were not updated to do cleanup. The first three commits address this.
- fbdev: hecubafb: fix potential memory leak in hecubafb_probe()
- fbdev: broadsheetfb: fix potential memory leak in broadsheetfb_probe()
- fbdev: metronomefb: fix potential memory leak in metronomefb_probe()

Probe functions that call fb_add_videomode() or fb_videomode_to_modelist() 
sometimes did not call fb_destry_modelist() to free the allocated
memory. The following patches address this issue.
- fbdev: radeon: fix potential memory leak in radeonfb_pci_register()
- fbdev: carminefb: fix potential memory leak in alloc_carmine_fb()
- fbdev: i740fb: fix potential memory leak in i740fb_probe()
- fbdev: nvidia: fix potential memory leak in nvidiafb_probe()
- fbdev: s3fb: fix potential memory leak in s3_pci_probe()
- fbdev: tdfxfb: fix potential memory leak in tdfxfb_probe()
- fbdev: tridentfb: fix potential memory leak in trident_pci_probe()
- fbdev: uvesafb: fix potential memory leak in uvesafb_probe()

Since commit 73ce73c30ba9 ("fbdev: Transfer video= option strings to caller; clarify ownership")
the fb_get_options() function transfers ownership of the memory
allocated for options, and so the caller is expected to free it. The
following two patches address this issue.
- fbdev: efifb: fix memory leak in efifb_probe()
- fbdev: vesafb: fix memory leak in vesafb_probe()

The following commit fixes a simple memory leak.
- fbdev: sm501fb: fix potential memory leak in sm501fb_probe()

All the patches were only compile tested.
The issues were found using static analysis.

Signed-off-by: Abdun Nihaal <nihaal@cse.iitm.ac.in>
---
Abdun Nihaal (14):
      fbdev: hecubafb: fix potential memory leak in hecubafb_probe()
      fbdev: broadsheetfb: fix potential memory leak in broadsheetfb_probe()
      fbdev: metronomefb: fix potential memory leak in metronomefb_probe()
      fbdev: radeon: fix potential memory leak in radeonfb_pci_register()
      fbdev: carminefb: fix potential memory leak in alloc_carmine_fb()
      fbdev: i740fb: fix potential memory leak in i740fb_probe()
      fbdev: nvidia: fix potential memory leak in nvidiafb_probe()
      fbdev: s3fb: fix potential memory leak in s3_pci_probe()
      fbdev: tdfxfb: fix potential memory leak in tdfxfb_probe()
      fbdev: tridentfb: fix potential memory leak in trident_pci_probe()
      fbdev: uvesafb: fix potential memory leak in uvesafb_probe()
      fbdev: efifb: fix memory leak in efifb_probe()
      fbdev: vesafb: fix memory leak in vesafb_probe()
      fbdev: sm501fb: fix potential memory leak in sm501fb_probe()

 drivers/video/fbdev/aty/radeon_base.c | 1 +
 drivers/video/fbdev/broadsheetfb.c    | 8 ++++++--
 drivers/video/fbdev/carminefb.c       | 1 +
 drivers/video/fbdev/efifb.c           | 1 +
 drivers/video/fbdev/hecubafb.c        | 6 +++++-
 drivers/video/fbdev/i740fb.c          | 1 +
 drivers/video/fbdev/metronomefb.c     | 8 ++++++--
 drivers/video/fbdev/nvidia/nvidia.c   | 1 +
 drivers/video/fbdev/s3fb.c            | 1 +
 drivers/video/fbdev/sm501fb.c         | 3 +++
 drivers/video/fbdev/tdfxfb.c          | 1 +
 drivers/video/fbdev/tridentfb.c       | 1 +
 drivers/video/fbdev/uvesafb.c         | 4 ++--
 drivers/video/fbdev/vesafb.c          | 1 +
 14 files changed, 31 insertions(+), 7 deletions(-)
---
base-commit: ba2e787b4814ebf9ab5f6a84181678b67eb3677b
change-id: 20260513-fbdev-99a53dc0754f

Best regards,
-- 
Abdun Nihaal <nihaal@cse.iitm.ac.in>


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2026-05-15  7:57 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-14  8:24 [PATCH 00/14] fbdev: fix various memory leaks Abdun Nihaal
2026-05-14  8:24 ` [PATCH 01/14] fbdev: hecubafb: fix potential memory leak in hecubafb_probe() Abdun Nihaal
2026-05-15  7:57   ` Thomas Zimmermann
2026-05-14  8:24 ` [PATCH 02/14] fbdev: broadsheetfb: fix potential memory leak in broadsheetfb_probe() Abdun Nihaal
2026-05-15  7:56   ` Thomas Zimmermann
2026-05-14  8:24 ` [PATCH 03/14] fbdev: metronomefb: fix potential memory leak in metronomefb_probe() Abdun Nihaal
2026-05-15  7:18   ` Thomas Zimmermann
2026-05-14  8:24 ` [PATCH 04/14] fbdev: radeon: fix potential memory leak in radeonfb_pci_register() Abdun Nihaal
2026-05-14  8:24 ` [PATCH 05/14] fbdev: carminefb: fix potential memory leak in alloc_carmine_fb() Abdun Nihaal
2026-05-14  8:24 ` [PATCH 06/14] fbdev: i740fb: fix potential memory leak in i740fb_probe() Abdun Nihaal
2026-05-14  8:24 ` [PATCH 07/14] fbdev: nvidia: fix potential memory leak in nvidiafb_probe() Abdun Nihaal
2026-05-14  8:24 ` [PATCH 08/14] fbdev: s3fb: fix potential memory leak in s3_pci_probe() Abdun Nihaal
2026-05-14  8:24 ` [PATCH 09/14] fbdev: tdfxfb: fix potential memory leak in tdfxfb_probe() Abdun Nihaal
2026-05-14  8:24 ` [PATCH 10/14] fbdev: tridentfb: fix potential memory leak in trident_pci_probe() Abdun Nihaal
2026-05-14  8:24 ` [PATCH 11/14] fbdev: uvesafb: fix potential memory leak in uvesafb_probe() Abdun Nihaal
2026-05-14  8:24 ` [PATCH 12/14] fbdev: efifb: fix memory leak in efifb_probe() Abdun Nihaal
2026-05-15  7:16   ` Thomas Zimmermann
2026-05-14  8:24 ` [PATCH 13/14] fbdev: vesafb: fix memory leak in vesafb_probe() Abdun Nihaal
2026-05-15  7:17   ` Thomas Zimmermann
2026-05-14  8:24 ` [PATCH 14/14] fbdev: sm501fb: fix potential memory leak in sm501fb_probe() Abdun Nihaal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox