Commit c99c1994 authored by Akinobu Mita's avatar Akinobu Mita Committed by Arnd Bergmann

[POWERPC] spufs: fix missing error handling in module_init()

spufs module_init forgot to call a few cleanup functions
on error path. This patch also includes cosmetic changes in
spu_sched_init() (identation fix and return error code).

[modified by hch to apply ontop of the latest schedule changes]

Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarAkinobu Mita <mita@fixstars.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarArnd Bergmann <arnd.bergmann@de.ibm.com>
parent 577f8f10
...@@ -661,25 +661,29 @@ static int __init spufs_init(void) ...@@ -661,25 +661,29 @@ static int __init spufs_init(void)
if (!spufs_inode_cache) if (!spufs_inode_cache)
goto out; goto out;
if (spu_sched_init() != 0) { ret = spu_sched_init();
kmem_cache_destroy(spufs_inode_cache);
goto out;
}
ret = register_filesystem(&spufs_type);
if (ret) if (ret)
goto out_cache; goto out_cache;
ret = register_filesystem(&spufs_type);
if (ret)
goto out_sched;
ret = register_spu_syscalls(&spufs_calls); ret = register_spu_syscalls(&spufs_calls);
if (ret) if (ret)
goto out_fs; goto out_fs;
ret = register_arch_coredump_calls(&spufs_coredump_calls); ret = register_arch_coredump_calls(&spufs_coredump_calls);
if (ret) if (ret)
goto out_fs; goto out_syscalls;
spufs_init_isolated_loader(); spufs_init_isolated_loader();
return 0; return 0;
out_syscalls:
unregister_spu_syscalls(&spufs_calls);
out_fs: out_fs:
unregister_filesystem(&spufs_type); unregister_filesystem(&spufs_type);
out_sched:
spu_sched_exit();
out_cache: out_cache:
kmem_cache_destroy(spufs_inode_cache); kmem_cache_destroy(spufs_inode_cache);
out: out:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment