Skip to content

Commit

Permalink
s390/hmcdrv: free memory on error path
Browse files Browse the repository at this point in the history
Free allocated page in case of error returned by hmcdrv_ftp_startup.

[heiko.carstens@de.ibm.com]: slightly changed Christophe's patch

Signed-off-by: Christophe Jaillet <christophe.jaillet@wanadoo.fr>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Christophe Jaillet authored and Martin Schwidefsky committed Jan 22, 2015
1 parent 93568d6 commit 2ec5049
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/s390/char/hmcdrv_ftp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
Expand Down

0 comments on commit 2ec5049

Please sign in to comment.