Free allocated page in case of error returned by hmcdrv_ftp_startup.

Signed-off-by: Christophe Jaillet <[email protected]>
---
 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to