* FAILED: patch "[PATCH] Staging: fbtft: fix memory leak in fbtft_framebuffer_alloc" failed to apply to 4.14-stable tree
@ 2019-10-14 14:59 gregkh
2019-10-15 0:43 ` Sasha Levin
0 siblings, 1 reply; 3+ messages in thread
From: gregkh @ 2019-10-14 14:59 UTC (permalink / raw)
To: navid.emamdoost, dan.carpenter, gregkh, stable; +Cc: stable
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 <stable@vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 5bdea6060618cfcf1459dca137e89aee038ac8b9 Mon Sep 17 00:00:00 2001
From: Navid Emamdoost <navid.emamdoost@gmail.com>
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.
Fixes: c296d5f9957c ("staging: fbtft: core support")
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@gmail.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20190930030949.28615-1-navid.emamdoost@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c
index cf5700a2ea66..a0a67aa517f0 100644
--- a/drivers/staging/fbtft/fbtft-core.c
+++ b/drivers/staging/fbtft/fbtft-core.c
@@ -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);
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: FAILED: patch "[PATCH] Staging: fbtft: fix memory leak in fbtft_framebuffer_alloc" failed to apply to 4.14-stable tree
2019-10-14 14:59 FAILED: patch "[PATCH] Staging: fbtft: fix memory leak in fbtft_framebuffer_alloc" failed to apply to 4.14-stable tree gregkh
@ 2019-10-15 0:43 ` Sasha Levin
2019-10-15 6:08 ` Greg KH
0 siblings, 1 reply; 3+ messages in thread
From: Sasha Levin @ 2019-10-15 0:43 UTC (permalink / raw)
To: gregkh; +Cc: navid.emamdoost, dan.carpenter, stable
On Mon, Oct 14, 2019 at 04:59:31PM +0200, gregkh@linuxfoundation.org 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 <stable@vger.kernel.org>.
>
>thanks,
>
>greg k-h
>
>------------------ original commit in Linus's tree ------------------
>
>From 5bdea6060618cfcf1459dca137e89aee038ac8b9 Mon Sep 17 00:00:00 2001
>From: Navid Emamdoost <navid.emamdoost@gmail.com>
>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.
>
>Fixes: c296d5f9957c ("staging: fbtft: core support")
>Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
>Reviewed-by: Dan Carpenter <dan.carpenter@gmail.com>
>Cc: stable <stable@vger.kernel.org>
>Link: https://lore.kernel.org/r/20190930030949.28615-1-navid.emamdoost@gmail.com
>Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Conflicts due to 333c7b940526b ("staging: fbtft: Fixes some alignment
issues - Style"). Fixed up and queued for 4.14-4.4.
--
Thanks,
Sasha
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: FAILED: patch "[PATCH] Staging: fbtft: fix memory leak in fbtft_framebuffer_alloc" failed to apply to 4.14-stable tree
2019-10-15 0:43 ` Sasha Levin
@ 2019-10-15 6:08 ` Greg KH
0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2019-10-15 6:08 UTC (permalink / raw)
To: Sasha Levin; +Cc: navid.emamdoost, dan.carpenter, stable
On Mon, Oct 14, 2019 at 08:43:05PM -0400, Sasha Levin wrote:
> On Mon, Oct 14, 2019 at 04:59:31PM +0200, gregkh@linuxfoundation.org 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 <stable@vger.kernel.org>.
> >
> > thanks,
> >
> > greg k-h
> >
> > ------------------ original commit in Linus's tree ------------------
> >
> > > From 5bdea6060618cfcf1459dca137e89aee038ac8b9 Mon Sep 17 00:00:00 2001
> > From: Navid Emamdoost <navid.emamdoost@gmail.com>
> > 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.
> >
> > Fixes: c296d5f9957c ("staging: fbtft: core support")
> > Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
> > Reviewed-by: Dan Carpenter <dan.carpenter@gmail.com>
> > Cc: stable <stable@vger.kernel.org>
> > Link: https://lore.kernel.org/r/20190930030949.28615-1-navid.emamdoost@gmail.com
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>
> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-10-15 6:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-14 14:59 FAILED: patch "[PATCH] Staging: fbtft: fix memory leak in fbtft_framebuffer_alloc" failed to apply to 4.14-stable tree gregkh
2019-10-15 0:43 ` Sasha Levin
2019-10-15 6:08 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).