]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
powerpc/spufs: add a missing mutex_unlock
authorKou Ishizaki <kou.ishizaki@toshiba.co.jp>
Wed, 8 Oct 2008 23:45:49 +0000 (10:45 +1100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 5 Dec 2008 18:55:23 +0000 (10:55 -0800)
commit 6747c2ee8abf749e63fee8cd01a9ee293e6a4247 upstream.

A mutex_unlock(&gang->aff_mutex) in spufs_create_context() is missing
in case spufs_context_open() fails.  As a result, spu_create syscall
and spu_get_idle() may block.

This patch adds the mutex_unlock.

Signed-off-by: Kou Ishizaki <kou.ishizaki@toshiba.co.jp>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Acked-by: Andre Detsch <adetsch@br.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/powerpc/platforms/cell/spufs/inode.c

index 690ca7b0dcf68e5f96562efef97b092b4a5433c6..5c73b62cc6b47615ca1c3f5af68a1c8a49354182 100644 (file)
@@ -496,6 +496,8 @@ spufs_create_context(struct inode *inode, struct dentry *dentry,
        ret = spufs_context_open(dget(dentry), mntget(mnt));
        if (ret < 0) {
                WARN_ON(spufs_rmdir(inode, dentry));
+               if (affinity)
+                       mutex_unlock(&gang->aff_mutex);
                mutex_unlock(&inode->i_mutex);
                spu_forget(SPUFS_I(dentry->d_inode)->i_ctx);
                goto out;