fs: add missing unlock in default_llseek()
authorDan Carpenter <error27@gmail.com>
Tue, 26 Jul 2011 14:25:20 +0000 (17:25 +0300)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 26 Jul 2011 16:57:09 +0000 (12:57 -0400)
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>
fs/read_write.c

index 5907b49e4d7ee42bbf6c613802a0522e0827107a..179f1c33ea578481cdc3388d54717089704a51a3 100644 (file)
@@ -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;
        }