[PATCH] s390: char: Free memory on error path.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Free allocated page in case of error returned by hmcdrv_ftp_startup.

Signed-off-by: Christophe Jaillet <christophe.jaillet@xxxxxxxxxx>
---
 drivers/s390/char/hmcdrv_ftp.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/s390/char/hmcdrv_ftp.c b/drivers/s390/char/hmcdrv_ftp.c
index 4bd6332..f6e00af 100644
--- a/drivers/s390/char/hmcdrv_ftp.c
+++ b/drivers/s390/char/hmcdrv_ftp.c
@@ -199,8 +199,10 @@ int hmcdrv_ftp_probe(void)
 
 	rc = hmcdrv_ftp_startup();
 
-	if (rc)
+	if (rc) {
+		free_page((unsigned long) ftp.buf);
 		return rc;
+	}
 
 	rc = hmcdrv_ftp_do(&ftp);
 	free_page((unsigned long) ftp.buf);
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux