Commit 344fe786 authored by Josh Triplett's avatar Josh Triplett Committed by Linus Torvalds

[PATCH] ufs: remove incorrect unlock_kernel from failure path in ufs_symlink()

ufs_symlink, in one of its error paths, calls unlock_kernel without ever
having called lock_kernel(); fix this by creating and jumping to a new
label out_notlocked rather than the out label used after calling
lock_kernel().
Signed-off-by: default avatarJosh Triplett <josh@freedesktop.org>
Cc: Evgeniy Dushistov <dushistov@mail.ru>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 0bee8d28
...@@ -129,7 +129,7 @@ static int ufs_symlink (struct inode * dir, struct dentry * dentry, ...@@ -129,7 +129,7 @@ static int ufs_symlink (struct inode * dir, struct dentry * dentry,
struct inode * inode; struct inode * inode;
if (l > sb->s_blocksize) if (l > sb->s_blocksize)
goto out; goto out_notlocked;
lock_kernel(); lock_kernel();
inode = ufs_new_inode(dir, S_IFLNK | S_IRWXUGO); inode = ufs_new_inode(dir, S_IFLNK | S_IRWXUGO);
...@@ -155,6 +155,7 @@ static int ufs_symlink (struct inode * dir, struct dentry * dentry, ...@@ -155,6 +155,7 @@ static int ufs_symlink (struct inode * dir, struct dentry * dentry,
err = ufs_add_nondir(dentry, inode); err = ufs_add_nondir(dentry, inode);
out: out:
unlock_kernel(); unlock_kernel();
out_notlocked:
return err; return err;
out_fail: out_fail:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment