aboutsummaryrefslogtreecommitdiffstats
path: root/fs/read_write.c
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2011-07-26 10:25:20 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2011-07-26 12:57:09 -0400
commitbacb2d816c77edefd464d6bcc04c07f92109bd7d (patch)
tree2a82f79385efd920a1610666865e796c3c653551 /fs/read_write.c
parent750e06992d49666a7589aac555eb3bb68e4dbb88 (diff)
fs: add missing unlock in default_llseek()
A recent change in linux-next, 982d816581 "fs: add SEEK_HOLE and SEEK_DATA flags" added some direct returns on error, but it should have been a goto out. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/read_write.c')
-rw-r--r--fs/read_write.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/read_write.c b/fs/read_write.c
index 5907b49e4d7e..179f1c33ea57 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -166,8 +166,10 @@ loff_t default_llseek(struct file *file, loff_t offset, int origin)
166 * long as offset isn't at the end of the file then the 166 * long as offset isn't at the end of the file then the
167 * offset is data. 167 * offset is data.
168 */ 168 */
169 if (offset >= inode->i_size) 169 if (offset >= inode->i_size) {
170 return -ENXIO; 170 retval = -ENXIO;
171 goto out;
172 }
171 break; 173 break;
172 case SEEK_HOLE: 174 case SEEK_HOLE:
173 /* 175 /*
@@ -175,8 +177,10 @@ loff_t default_llseek(struct file *file, loff_t offset, int origin)
175 * as long as offset isn't i_size or larger, return 177 * as long as offset isn't i_size or larger, return
176 * i_size. 178 * i_size.
177 */ 179 */
178 if (offset >= inode->i_size) 180 if (offset >= inode->i_size) {
179 return -ENXIO; 181 retval = -ENXIO;
182 goto out;
183 }
180 offset = inode->i_size; 184 offset = inode->i_size;
181 break; 185 break;
182 } 186 }