Subject: spufs: fix memory leak on spufs reloading From: Akinobu Mita When SPU isolation mode enabled, isolated_loader would be allocated by spufs_init_isolated_loader() on module_init(). But anyone do not free it. This patch introduces spufs_exit_isolated_loader() which is the opposite of spufs_init_isolated_loader() and called on module_exit(). Cc: Arnd Bergmann Signed-off-by: Akinobu Mita Signed-off-by: Christoph Hellwig Signed-off-by: Arnd Bergmann --- arch/powerpc/platforms/cell/spufs/inode.c | 6 ++++++ 1 file changed, 6 insertions(+) Index: linux-sdk2.1/arch/powerpc/platforms/cell/spufs/inode.c =================================================================== --- linux-sdk2.1.orig/arch/powerpc/platforms/cell/spufs/inode.c +++ linux-sdk2.1/arch/powerpc/platforms/cell/spufs/inode.c @@ -681,6 +681,11 @@ spufs_parse_options(char *options, struc return 1; } +static void spufs_exit_isolated_loader(void) +{ + kfree(isolated_loader); +} + static void spufs_init_isolated_loader(void) { @@ -810,6 +815,7 @@ module_init(spufs_init); static void __exit spufs_exit(void) { spu_sched_exit(); + spufs_exit_isolated_loader(); unregister_arch_coredump_calls(&spufs_coredump_calls); unregister_spu_syscalls(&spufs_calls); unregister_filesystem(&spufs_type);