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)
committerJeremy Kerr <jk@ozlabs.org>
Fri, 10 Oct 2008 00:06:17 +0000 (11:06 +1100)
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>
arch/powerpc/platforms/cell/spufs/inode.c

index d79ac67c9df12f26b7f0cb5a12afe2484279863d..6b7c7b132454d02099938d673a6a4f4af4e49677 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;