Re: Misc 2.5 Fixes: mem-leak-rio

Dipankar Sarma (dipankar@in.ibm.com)
Tue, 10 Jun 2003 15:54:05 +0530


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;

_
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/