# Re: \[PATCH 13/14\] fbdev: vesafb: fix memory leak in vesafb\_probe()

- From: Thomas Zimmermann \<tzimmermann@suse.de\>
- Date: 2026-05-15 07:17:11 
- List: linux-fbdev
- Page: https://ratatoskr.run/linux-fbdev/2026/05/9008634
- Thread: https://ratatoskr.run/linux-fbdev/2026/05/9006088/t.md

```text


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
> vesafb_probe(). Fix that by freeing the option string after setup.
>
> Fixes: 73ce73c30ba9 ("fbdev: Transfer video= option strings to caller; clarify ownership")
> Cc: <redacted>
> Signed-off-by: Abdun Nihaal <redacted>

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>

> ---
>   drivers/video/fbdev/vesafb.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/video/fbdev/vesafb.c b/drivers/video/fbdev/vesafb.c
> index f84f4db244bf..f1902056bd73 100644
> --- a/drivers/video/fbdev/vesafb.c
> +++ b/drivers/video/fbdev/vesafb.c
> @@ -269,6 +269,7 @@ static int vesafb_probe(struct platform_device *dev)
>   	/* ignore error return of fb_get_options */
>   	fb_get_options("vesafb", &option);
>   	vesafb_setup(option);
> +	kfree(option);
>   
>   	if (si->orig_video_isVGA != VIDEO_TYPE_VLFB)
>   		return -ENODEV;
>

-- 
--
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)


```
