powerpc/spufs: Fix double unlocks
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 7 Mar 2012 11:01:35 +0000 (11:01 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 21 Mar 2012 00:16:10 +0000 (11:16 +1100)
spufs return path has a bug where it could end up trying to
unlock an inode mutex twice. Fix it.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/platforms/cell/spufs/inode.c
arch/powerpc/platforms/cell/spufs/syscalls.c

index d4a094ca96f3c18379d2a321514f9423c889012a..114ab14cb7d889a72001bfc7ae806670dccb19b1 100644 (file)
@@ -646,6 +646,7 @@ long spufs_create(struct path *path, struct dentry *dentry,
 
 out:
        mutex_unlock(&path->dentry->d_inode->i_mutex);
+       dput(dentry);
        return ret;
 }
 
index 8591bb62d7fca91580ee30896ba22bd66d8a436d..5665dcc382c7350208e5c2b084a0e94761ce5051 100644 (file)
@@ -70,8 +70,6 @@ static long do_spu_create(const char __user *pathname, unsigned int flags,
        ret = PTR_ERR(dentry);
        if (!IS_ERR(dentry)) {
                ret = spufs_create(&path, dentry, flags, mode, neighbor);
-               mutex_unlock(&path.dentry->d_inode->i_mutex);
-               dput(dentry);
                path_put(&path);
        }