Patchwork powerpc/spufs: add a missing mutex_unlock

login
register
mail settings
Submitter Kou Ishizaki
Date Sept. 30, 2008, 10:09 a.m.
Message ID <20080930.190942.-1300537374.kouish@swc.toshiba.co.jp>
Download mbox | patch
Permalink /patch/2077/
State Accepted
Headers show

Comments

Kou Ishizaki - Sept. 30, 2008, 10:09 a.m.
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>
---
 arch/powerpc/platforms/cell/spufs/inode.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

		goto out;
Andre Detsch - Oct. 1, 2008, 12:41 p.m.
Kou Ishizaki wrote:
> 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>

Acked-by: Andre Detsch <adetsch@br.ibm.com>

Patch

diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c
index 690ca7b..5c73b62 100644
--- a/arch/powerpc/platforms/cell/spufs/inode.c
+++ b/arch/powerpc/platforms/cell/spufs/inode.c
@@ -496,5 +496,7 @@  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);