From: Josh Triplett Date: Sun, 30 Jul 2006 10:03:59 +0000 (-0700) Subject: [PATCH] ufs: remove incorrect unlock_kernel from failure path in ufs_symlink() X-Git-Tag: v2.6.18-rc4~100 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=344fe78669d2d1cff9e8939598f6d0d865b6a75b;p=linux-2.6 [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: Josh Triplett Cc: Evgeniy Dushistov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/ufs/namei.c b/fs/ufs/namei.c index abd5f23a42..d344b411e2 100644 --- a/fs/ufs/namei.c +++ b/fs/ufs/namei.c @@ -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); @@ -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: