]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
[POWERPC] spufs: fix memory leak on spufs reloading
authorAkinobu Mita <mita@fixstars.com>
Mon, 23 Apr 2007 19:08:20 +0000 (21:08 +0200)
committerArnd Bergmann <arnd@klappe.arndb.de>
Mon, 23 Apr 2007 19:18:57 +0000 (21:18 +0200)
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 <arnd@arndb.de>
Signed-off-by: Akinobu Mita <mita@fixstars.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
arch/powerpc/platforms/cell/spufs/inode.c

index 5d09c2e8f39a3bf325e45f07ce29b9f24c28acd6..6b52dfabaeefee97a417cd843b18c92db07d444f 100644 (file)
@@ -561,6 +561,11 @@ spufs_parse_options(char *options, struct inode *root)
        return 1;
 }
 
+static void spufs_exit_isolated_loader(void)
+{
+       kfree(isolated_loader);
+}
+
 static void
 spufs_init_isolated_loader(void)
 {
@@ -694,6 +699,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);