提交 bacb2d81 编写于 作者: D Dan Carpenter 提交者: Al Viro

fs: add missing unlock in default_llseek()

A recent change in linux-next, 982d8165 "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: NDan Carpenter <error27@gmail.com>
Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 750e0699
......@@ -166,8 +166,10 @@ 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:
/*
......@@ -175,8 +177,10 @@ loff_t default_llseek(struct file *file, loff_t offset, int origin)
* 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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册