diff options
author | Josh Triplett <josht@us.ibm.com> | 2006-07-30 06:03:58 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-31 16:28:41 -0400 |
commit | 0aa9e4f147880b2d7d1eef1f0b45112af0e36f9f (patch) | |
tree | 2353795f3b72fc0fc5bffd1584bc3f45d82a775e /fs/efs | |
parent | 6ecbc4e1a395062a8e99e4f5fe328f6ba166d9c8 (diff) |
[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>
Diffstat (limited to 'fs/efs')
-rw-r--r-- | fs/efs/symlink.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/efs/symlink.c b/fs/efs/symlink.c index e249cf733a6b..1d30d2ff440f 100644 --- a/fs/efs/symlink.c +++ b/fs/efs/symlink.c | |||
@@ -22,7 +22,7 @@ static int efs_symlink_readpage(struct file *file, struct page *page) | |||
22 | 22 | ||
23 | err = -ENAMETOOLONG; | 23 | err = -ENAMETOOLONG; |
24 | if (size > 2 * EFS_BLOCKSIZE) | 24 | if (size > 2 * EFS_BLOCKSIZE) |
25 | goto fail; | 25 | goto fail_notlocked; |
26 | 26 | ||
27 | lock_kernel(); | 27 | lock_kernel(); |
28 | /* read first 512 bytes of link target */ | 28 | /* read first 512 bytes of link target */ |
@@ -47,6 +47,7 @@ static int efs_symlink_readpage(struct file *file, struct page *page) | |||
47 | return 0; | 47 | return 0; |
48 | fail: | 48 | fail: |
49 | unlock_kernel(); | 49 | unlock_kernel(); |
50 | fail_notlocked: | ||
50 | SetPageError(page); | 51 | SetPageError(page); |
51 | kunmap(page); | 52 | kunmap(page); |
52 | unlock_page(page); | 53 | unlock_page(page); |