[Cbe-oss-dev] [PATCH] memory leak on SPU coredump

Akinobu Mita mita at fixstars.com
Tue Mar 13 17:07:33 EST 2007


Dynamically allocated read/write buffer in spufs_arch_write_note()
will not be freed.

Cc: Arnd Bergmann <arnd at arndb.de>
Signed-off-by: Akinobu Mita <mita at fixstars.com>

Index: 2.6-git-ps3/arch/powerpc/platforms/cell/spufs/coredump.c
===================================================================
--- 2.6-git-ps3.orig/arch/powerpc/platforms/cell/spufs/coredump.c
+++ 2.6-git-ps3/arch/powerpc/platforms/cell/spufs/coredump.c
@@ -212,6 +212,7 @@ static void spufs_arch_write_note(struct
 		}
 	} while (rc == bufsz && total < sz);
 
+	kfree(buf);
 	spufs_dump_seek(file, roundup((unsigned long)file->f_pos
 						- total + sz, 4));
 }



More information about the cbe-oss-dev mailing list