lkml.org 
[lkml]   [2015]   [Jan]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] s390: char: Free memory on error path.
Date
Free allocated page in case of error returned by hmcdrv_ftp_startup.

Signed-off-by: Christophe Jaillet <christophe.jaillet@wanadoo.fr>
---
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


\
 
 \ /
  Last update: 2015-01-19 23:21    [W:0.388 / U:0.684 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site