From: Martin Schwidefsky <schwidefsky@de.ibm.com>
To: Christophe Jaillet <christophe.jaillet@wanadoo.fr>
Cc: heiko.carstens@de.ibm.com, linux390@de.ibm.com,
linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] s390: char: con3215: Free memory in error path
Date: Mon, 20 Apr 2015 08:32:07 +0000 [thread overview]
Message-ID: <20150420103207.7491723c@mschwide> (raw)
In-Reply-To: <1429449456-4050-1-git-send-email-christophe.jaillet@wanadoo.fr>
On Sun, 19 Apr 2015 15:17:36 +0200
Christophe Jaillet <christophe.jaillet@wanadoo.fr> wrote:
> If one memory allocation fails, there is a memory leak.
>
> Signed-off-by: Christophe Jaillet <christophe.jaillet@wanadoo.fr>
> ---
> drivers/s390/char/con3215.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c
> index c43aca6..0fc3fe5 100644
> --- a/drivers/s390/char/con3215.c
> +++ b/drivers/s390/char/con3215.c
> @@ -667,6 +667,8 @@ static struct raw3215_info *raw3215_alloc_info(void)
> info->buffer = kzalloc(RAW3215_BUFFER_SIZE, GFP_KERNEL | GFP_DMA);
> info->inbuf = kzalloc(RAW3215_INBUF_SIZE, GFP_KERNEL | GFP_DMA);
> if (!info->buffer || !info->inbuf) {
> + kfree(info->inbuf);
> + kfree(info->buffer);
> kfree(info);
> return NULL;
> }
Applied, thanks.
--
blue skies,
Martin.
"Reality continues to ruin my life." - Calvin.
prev parent reply other threads:[~2015-04-20 8:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-19 13:17 [PATCH] s390: char: con3215: Free memory in error path Christophe Jaillet
2015-04-20 8:32 ` Martin Schwidefsky [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150420103207.7491723c@mschwide \
--to=schwidefsky@de.ibm.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=heiko.carstens@de.ibm.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=linux390@de.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox