From: Heiko Carstens <heiko.carstens@de.ibm.com>
To: Christophe Jaillet <christophe.jaillet@wanadoo.fr>
Cc: schwidefsky@de.ibm.com, rhoppe@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: Free memory on error path.
Date: Tue, 20 Jan 2015 10:30:40 +0000 [thread overview]
Message-ID: <20150120103040.GA3928@osiris> (raw)
In-Reply-To: <1421704920-29820-1-git-send-email-christophe.jaillet@wanadoo.fr>
On Mon, Jan 19, 2015 at 11:02:00PM +0100, Christophe Jaillet wrote:
> Free allocated page in case of error returned by hmcdrv_ftp_startup.
>
> Signed-off-by: Christophe Jaillet <christophe.jaillet@wanadoo.fr>
Thanks, I applied the version below.
From e38409df9fdbe8b4667cc2ee0e44ff5825ed7049 Mon Sep 17 00:00:00 2001
From: Christophe Jaillet <christophe.jaillet@wanadoo.fr>
Date: Mon, 19 Jan 2015 23:02:00 +0100
Subject: [PATCH] s390/hmcdrv: free memory on error path
Free allocated page in case of error returned by hmcdrv_ftp_startup.
[heiko.carstens@de.ibm.com]: slightly changed Christophe's patch
Signed-off-by: Christophe Jaillet <christophe.jaillet@wanadoo.fr>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
---
drivers/s390/char/hmcdrv_ftp.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/s390/char/hmcdrv_ftp.c b/drivers/s390/char/hmcdrv_ftp.c
index 4bd63322fc29..d4b61d9088fb 100644
--- a/drivers/s390/char/hmcdrv_ftp.c
+++ b/drivers/s390/char/hmcdrv_ftp.c
@@ -200,10 +200,9 @@ int hmcdrv_ftp_probe(void)
rc = hmcdrv_ftp_startup();
if (rc)
- return rc;
+ goto out;
rc = hmcdrv_ftp_do(&ftp);
- free_page((unsigned long) ftp.buf);
hmcdrv_ftp_shutdown();
switch (rc) {
@@ -216,7 +215,8 @@ int hmcdrv_ftp_probe(void)
rc = 0; /* clear length (success) */
break;
} /* switch */
-
+out:
+ free_page((unsigned long) ftp.buf);
return rc;
}
EXPORT_SYMBOL(hmcdrv_ftp_probe);
--
2.1.4
prev parent reply other threads:[~2015-01-20 10:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-19 22:02 [PATCH] s390: char: Free memory on error path Christophe Jaillet
2015-01-19 22:06 ` Christophe JAILLET
2015-01-20 10:30 ` Heiko Carstens [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=20150120103040.GA3928@osiris \
--to=heiko.carstens@de.ibm.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=linux390@de.ibm.com \
--cc=rhoppe@de.ibm.com \
--cc=schwidefsky@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;
as well as URLs for NNTP newsgroup(s).