Re: Misc 2.5 Fixes: mem-leak-rio

Dipankar Sarma
2003-06-10T10:09:11Z

Fix memory leak - free on copyin failure.

drivers/char/rio/rioboot.c | 1 +
1 files changed, 1 insertion(+)

diff -puN drivers/char/rio/rioboot.c~mem-leak-rio drivers/char/rio/rioboot.c
--- linux-2.5.70-ds/drivers/char/rio/rioboot.c~mem-leak-rio 2003-06-08 21:21:50.000000000 +0530
+++ linux-2.5.70-ds-dipankar/drivers/char/rio/rioboot.c 2003-06-08 21:21:50.000000000 +0530
@@ -326,6 +326,7 @@ register struct DownLoad *rbp;

if ( copyin((int)rbp->DataP,DownCode,rbp->Count)==COPYFAIL ) {
rio_dprintk (RIO_DEBUG_BOOT, "Bad copyin of host data\n");
+ sysfree( DownCode, rbp->Count );
p->RIOError.Error = COPYIN_FAILED;
func_exit ();
return -EFAULT;

_