Skip to content

Commit

Permalink
[PATCH] efs: Remove incorrect unlock_kernel from failure path in efs_…
Browse files Browse the repository at this point in the history
…symlink_readpage()

If efs_symlink_readpage hits the -ENAMETOOLONG error path, it will call
unlock_kernel without ever having called lock_kernel(); fix this by
creating and jumping to a new label fail_notlocked rather than the fail
label used after calling lock_kernel().

Signed-off-by: Josh Triplett <[email protected]>
Cc: Marcelo Tosatti <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Josh Triplett authored and Linus Torvalds committed Jul 31, 2006
1 parent 6ecbc4e commit 0aa9e4f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/efs/symlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ static int efs_symlink_readpage(struct file *file, struct page *page)

err = -ENAMETOOLONG;
if (size > 2 * EFS_BLOCKSIZE)
goto fail;
goto fail_notlocked;

lock_kernel();
/* read first 512 bytes of link target */
Expand All @@ -47,6 +47,7 @@ static int efs_symlink_readpage(struct file *file, struct page *page)
return 0;
fail:
unlock_kernel();
fail_notlocked:
SetPageError(page);
kunmap(page);
unlock_page(page);
Expand Down

0 comments on commit 0aa9e4f

Please sign in to comment.