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

From: Christophe Jaillet
Date: Mon Jan 19 2015 - 17:02:50 EST


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 linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/