s390/hmcdrv: free memory on error path
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>
This commit is contained in:
Родитель
93568d6fc5
Коммит
2ec504934e
|
@ -200,10 +200,9 @@ int hmcdrv_ftp_probe(void)
|
||||||
rc = hmcdrv_ftp_startup();
|
rc = hmcdrv_ftp_startup();
|
||||||
|
|
||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
goto out;
|
||||||
|
|
||||||
rc = hmcdrv_ftp_do(&ftp);
|
rc = hmcdrv_ftp_do(&ftp);
|
||||||
free_page((unsigned long) ftp.buf);
|
|
||||||
hmcdrv_ftp_shutdown();
|
hmcdrv_ftp_shutdown();
|
||||||
|
|
||||||
switch (rc) {
|
switch (rc) {
|
||||||
|
@ -216,7 +215,8 @@ int hmcdrv_ftp_probe(void)
|
||||||
rc = 0; /* clear length (success) */
|
rc = 0; /* clear length (success) */
|
||||||
break;
|
break;
|
||||||
} /* switch */
|
} /* switch */
|
||||||
|
out:
|
||||||
|
free_page((unsigned long) ftp.buf);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(hmcdrv_ftp_probe);
|
EXPORT_SYMBOL(hmcdrv_ftp_probe);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче