lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20150120103040.GA3928@osiris>
Date:	Tue, 20 Jan 2015 11:30:40 +0100
From:	Heiko Carstens <heiko.carstens@...ibm.com>
To:	Christophe Jaillet <christophe.jaillet@...adoo.fr>
Cc:	schwidefsky@...ibm.com, rhoppe@...ibm.com, linux390@...ibm.com,
	linux-s390@...r.kernel.org, linux-kernel@...r.kernel.org,
	kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] s390: char: Free memory on error path.

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@...adoo.fr>

Thanks, I applied the version below.

>From e38409df9fdbe8b4667cc2ee0e44ff5825ed7049 Mon Sep 17 00:00:00 2001
From: Christophe Jaillet <christophe.jaillet@...adoo.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@...ibm.com]: slightly changed Christophe's patch

Signed-off-by: Christophe Jaillet <christophe.jaillet@...adoo.fr>
Signed-off-by: Heiko Carstens <heiko.carstens@...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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ