mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
[PATCH] efs: Remove incorrect unlock_kernel from failure path in efs_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 <josh@freedesktop.org> Cc: Marcelo Tosatti <marcelo.tosatti@cyclades.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
6ecbc4e1a3
commit
0aa9e4f147
1 changed files with 2 additions and 1 deletions
|
@ -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 */
|
||||
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue