diff options
author | Akinobu Mita <mita@fixstars.com> | 2007-04-23 15:08:19 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@klappe.arndb.de> | 2007-04-23 15:18:56 -0400 |
commit | c99c1994a2bb9493b4ac372b2b6ee2606d291171 (patch) | |
tree | fd160994c89dad01c8e6bcb63e5d350768e88945 | |
parent | 577f8f1021f9ee6ef2a98a142652759ec122d27f (diff) |
[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: Akinobu Mita <mita@fixstars.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/inode.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c index 423596a6b995..5d09c2e8f39a 100644 --- a/arch/powerpc/platforms/cell/spufs/inode.c +++ b/arch/powerpc/platforms/cell/spufs/inode.c | |||
@@ -661,25 +661,29 @@ static int __init spufs_init(void) | |||
661 | 661 | ||
662 | if (!spufs_inode_cache) | 662 | if (!spufs_inode_cache) |
663 | goto out; | 663 | goto out; |
664 | if (spu_sched_init() != 0) { | 664 | ret = spu_sched_init(); |
665 | kmem_cache_destroy(spufs_inode_cache); | ||
666 | goto out; | ||
667 | } | ||
668 | ret = register_filesystem(&spufs_type); | ||
669 | if (ret) | 665 | if (ret) |
670 | goto out_cache; | 666 | goto out_cache; |
667 | ret = register_filesystem(&spufs_type); | ||
668 | if (ret) | ||
669 | goto out_sched; | ||
671 | ret = register_spu_syscalls(&spufs_calls); | 670 | ret = register_spu_syscalls(&spufs_calls); |
672 | if (ret) | 671 | if (ret) |
673 | goto out_fs; | 672 | goto out_fs; |
674 | ret = register_arch_coredump_calls(&spufs_coredump_calls); | 673 | ret = register_arch_coredump_calls(&spufs_coredump_calls); |
675 | if (ret) | 674 | if (ret) |
676 | goto out_fs; | 675 | goto out_syscalls; |
677 | 676 | ||
678 | spufs_init_isolated_loader(); | 677 | spufs_init_isolated_loader(); |
679 | 678 | ||
680 | return 0; | 679 | return 0; |
680 | |||
681 | out_syscalls: | ||
682 | unregister_spu_syscalls(&spufs_calls); | ||
681 | out_fs: | 683 | out_fs: |
682 | unregister_filesystem(&spufs_type); | 684 | unregister_filesystem(&spufs_type); |
685 | out_sched: | ||
686 | spu_sched_exit(); | ||
683 | out_cache: | 687 | out_cache: |
684 | kmem_cache_destroy(spufs_inode_cache); | 688 | kmem_cache_destroy(spufs_inode_cache); |
685 | out: | 689 | out: |