Skip to content

Commit

Permalink
[PATCH] ufs: remove incorrect unlock_kernel from failure path in ufs_…
Browse files Browse the repository at this point in the history
…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: Josh Triplett <josh@freedesktop.org>
Cc: Evgeniy Dushistov <dushistov@mail.ru>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Josh Triplett authored and Linus Torvalds committed Jul 31, 2006
1 parent 0bee8d2 commit 344fe78
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/ufs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ static int ufs_symlink (struct inode * dir, struct dentry * dentry,
struct inode * inode;

if (l > sb->s_blocksize)
goto out;
goto out_notlocked;

lock_kernel();
inode = ufs_new_inode(dir, S_IFLNK | S_IRWXUGO);
Expand All @@ -155,6 +155,7 @@ static int ufs_symlink (struct inode * dir, struct dentry * dentry,
err = ufs_add_nondir(dentry, inode);
out:
unlock_kernel();
out_notlocked:
return err;

out_fail:
Expand Down

0 comments on commit 344fe78

Please sign in to comment.