FAILED: patch "[PATCH] Staging: fbtft: fix memory leak in fbtft_framebuffer_alloc" failed to apply to 4.14-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 4.14-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 5bdea6060618cfcf1459dca137e89aee038ac8b9 Mon Sep 17 00:00:00 2001
From: Navid Emamdoost <[email protected]>
Date: Sun, 29 Sep 2019 22:09:45 -0500
Subject: [PATCH] Staging: fbtft: fix memory leak in fbtft_framebuffer_alloc
In fbtft_framebuffer_alloc the error handling path should take care of releasing frame buffer after it is allocated via framebuffer_alloc, too. Therefore, in two failure cases the goto destination is changed to address this issue.
drivers/staging/fbtft/fbtft-core.c +5 -2
@@ -714,7 +714,7 @@ struct fb_info *fbtft_framebuffer_alloc(struct fbtft_display *display,if (par->gamma.curves && gamma) {if (fbtft_gamma_parse_str (par, par->gamma.curves, gamma,strlen (gamma))) - goto alloc_fail; + goto release_framebuf; }/* Transmit buffer */
@@ -731,7 +731,7 @@ struct fb_info *fbtft_framebuffer_alloc(struct fbtft_display *display,if (txbuflen >0 ) { txbuf =devm_kzalloc (par->info->device, txbuflen,GFP_KERNEL );if (!txbuf) - goto alloc_fail; + goto release_framebuf; par->txbuf.buf = txbuf; par->txbuf.len = txbuflen; }
@@ -753,6 +753,9 @@ struct fb_info *fbtft_framebuffer_alloc(struct fbtft_display *display,return info; +release_framebuf: +framebuffer_release (info); + alloc_fail:vfree (vmem);
Sasha Levin
maintainerQuoted 22 lines · On Mon, Oct 14, 2019 at 04:59:31PM +0200, [email protected] wrote:
The patch below does not apply to the 4.14-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From
5bdea6060618cfcf1459dca137e89aee038ac8b9Mon Sep 17 00:00:00 2001
From: Navid Emamdoost <[email protected]>
Date: Sun, 29 Sep 2019 22:09:45 -0500
Subject: [PATCH] Staging: fbtft: fix memory leak infbtft_framebuffer_allocIn
fbtft_framebuffer_allocthe error handling path should take care of releasing frame buffer after it is allocated viaframebuffer_alloc, too. Therefore, in two failure cases the goto destination is changed to address this issue.
Quoted 6 lines
Fixes c296d5f9957c ("staging: fbtft: core support")Signed-off-by Navid Emamdoost <[email protected]>Reviewed-by Dan Carpenter <[email protected]>Cc stable <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>
Conflicts due to 333c7b940526b ("staging: fbtft: Fixes some alignment issues - Style"). Fixed up and queued for 4.14-4.4.
Signature · 2 lines
Thanks, Sasha
Greg KH
maintainerQuoted 30 lines · Sasha Levin
Quoted 22 lines · On Mon, Oct 14, 2019 at 04:59:31PM +0200, [email protected] wrote:
The patch below does not apply to the 4.14-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
Quoted 1 line
From
5bdea6060618cfcf1459dca137e89aee038ac8b9Mon Sep 17 00:00:00 2001From: Navid Emamdoost <[email protected]>
Date: Sun, 29 Sep 2019 22:09:45 -0500
Subject: [PATCH] Staging: fbtft: fix memory leak infbtft_framebuffer_allocIn
fbtft_framebuffer_allocthe error handling path should take care of releasing frame buffer after it is allocated viaframebuffer_alloc, too. Therefore, in two failure cases the goto destination is changed to address this issue.Quoted 6 lines
Fixes c296d5f9957c ("staging: fbtft: core support")Signed-off-by Navid Emamdoost <[email protected]>Reviewed-by Dan Carpenter <[email protected]>Cc stable <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>
Quoted 2 lines
Conflicts due to
333c7b940526b("staging: fbtft: Fixes some alignment issues - Style"). Fixed up and queued for 4.14-4.4.
Thanks for fixing this one, and the other failures up.
greg k-h