btrfs: unlock on error in btrfs_file_llseek()
authorDan Carpenter <error27@gmail.com>
Thu, 18 Aug 2011 14:16:05 +0000 (10:16 -0400)
committerChris Mason <chris.mason@oracle.com>
Thu, 18 Aug 2011 14:16:05 +0000 (10:16 -0400)
There were some unlocks on error missing in a recent patch to
btrfs_file_llseek().

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/file.c

index 658d66959abe9eca7608f650d73bd9952a053ac4..f7d9df7f3fddbabc6f5d390a28a3efbb00882e88 100644 (file)
@@ -1804,10 +1804,14 @@ static loff_t btrfs_file_llseek(struct file *file, loff_t offset, int origin)
                }
        }
 
-       if (offset < 0 && !(file->f_mode & FMODE_UNSIGNED_OFFSET))
-               return -EINVAL;
-       if (offset > inode->i_sb->s_maxbytes)
-               return -EINVAL;
+       if (offset < 0 && !(file->f_mode & FMODE_UNSIGNED_OFFSET)) {
+               ret = -EINVAL;
+               goto out;
+       }
+       if (offset > inode->i_sb->s_maxbytes) {
+               ret = -EINVAL;
+               goto out;
+       }
 
        /* Special lock needed here? */
        if (offset != file->f_pos) {