Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Christophe Jaillet and committed by
Martin Schwidefsky
2ec50493 93568d6f

+3 -3
+3 -3
drivers/s390/char/hmcdrv_ftp.c
··· 200 200 rc = hmcdrv_ftp_startup(); 201 201 202 202 if (rc) 203 - return rc; 203 + goto out; 204 204 205 205 rc = hmcdrv_ftp_do(&ftp); 206 - free_page((unsigned long) ftp.buf); 207 206 hmcdrv_ftp_shutdown(); 208 207 209 208 switch (rc) { ··· 215 216 rc = 0; /* clear length (success) */ 216 217 break; 217 218 } /* switch */ 218 - 219 + out: 220 + free_page((unsigned long) ftp.buf); 219 221 return rc; 220 222 } 221 223 EXPORT_SYMBOL(hmcdrv_ftp_probe);