Re: [PATCH 12/14] fbdev: efifb: fix memory leak in efifb_probe()

From
Thomas Zimmermann <tzimmermann@suse.de>
Date
2026-05-15 07:16:59
Also in
dri-devel, lkml, stable
Reply to
Abdun Nihaal, 2026-05-14
Hi

Am 14.05.26 um 10:24 schrieb Abdun Nihaal:
Since commit 73ce73c30ba9 ("fbdev: Transfer video= option strings to
caller; clarify ownership") the string returned from fb_get_options()
is expected to be freed by the caller, but the string is not freed in
efifb_probe(). Fix that by freeing the option string after setup.

Fixes: 73ce73c30ba9 ("fbdev: Transfer video= option strings to caller; clarify ownership")
Right, the commit message even mentions the (pre-existing) leak. There might be other drivers with a similar issue.
Cc: <redacted>
Signed-off-by: Abdun Nihaal <redacted>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
quoted hunk ↗ jump to hunk
---
  drivers/video/fbdev/efifb.c | 1 +
  1 file changed, 1 insertion(+)
diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c
index 47ebc0107209..ad8dec7807c3 100644
--- a/drivers/video/fbdev/efifb.c
+++ b/drivers/video/fbdev/efifb.c
@@ -377,6 +377,7 @@ static int efifb_probe(struct platform_device *dev)
  	if (fb_get_options("efifb", &option))
  		return -ENODEV;
  	efifb_setup(si, option);
+	kfree(option);
  
  	/* We don't get linelength from UGA Draw Protocol, only from
  	 * EFI Graphics Protocol.  So if it's not in DMI, and it's not
-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)

Thread (21 messages) 21 messages, 3 authors, last reply 2026-05-19
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help