]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
fbdev: efifb: fix memory leak in efifb_probe()
authorAbdun Nihaal <nihaal@cse.iitm.ac.in>
Thu, 14 May 2026 08:24:41 +0000 (13:54 +0530)
committerHelge Deller <deller@gmx.de>
Sun, 7 Jun 2026 16:25:42 +0000 (18:25 +0200)
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")
Cc: stable@vger.kernel.org
Signed-off-by: Abdun Nihaal <nihaal@cse.iitm.ac.in>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Helge Deller <deller@gmx.de>
drivers/video/fbdev/efifb.c

index 47ebc0107209eec28c1c523e54b1618fb8435c30..ad8dec7807c3a5a33f0d65209f80ea38b6ac46b7 100644 (file)
@@ -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