Skip to content

Commit

Permalink
fs: add missing unlock in default_llseek()
Browse files Browse the repository at this point in the history
A recent change in linux-next, 982d816 "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>
  • Loading branch information
Dan Carpenter authored and Al Viro committed Jul 26, 2011
1 parent 750e069 commit bacb2d8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions fs/read_write.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,17 +166,21 @@ loff_t default_llseek(struct file *file, loff_t offset, int origin)
* long as offset isn't at the end of the file then the
* offset is data.
*/
if (offset >= inode->i_size)
return -ENXIO;
if (offset >= inode->i_size) {
retval = -ENXIO;
goto out;
}
break;
case SEEK_HOLE:
/*
* There is a virtual hole at the end of the file, so
* as long as offset isn't i_size or larger, return
* i_size.
*/
if (offset >= inode->i_size)
return -ENXIO;
if (offset >= inode->i_size) {
retval = -ENXIO;
goto out;
}
offset = inode->i_size;
break;
}
Expand Down

0 comments on commit bacb2d8

Please sign in to comment.