From: Dan Carpenter Date: Tue, 26 Jul 2011 14:25:20 +0000 (+0300) Subject: fs: add missing unlock in default_llseek() X-Git-Tag: v3.12-rc1~5165^2~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bacb2d816c77edefd464d6bcc04c07f92109bd7d;p=kernel%2Fkernel-generic.git 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 Signed-off-by: Al Viro --- diff --git a/fs/read_write.c b/fs/read_write.c index 5907b49..179f1c3 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) * 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; }