aboutsummaryrefslogtreecommitdiff
path: root/kernel/fs
diff options
context:
space:
mode:
authorplougher <plougher>2009-01-31 07:11:11 +0000
committerMohamad Ayyash <mkayyash@google.com>2015-02-23 12:34:11 -0800
commit1931723ba8788fc58882550c16d367375fd245e5 (patch)
tree3637150f09dadab3658c77d621a8e1a41e687512 /kernel/fs
parentb4512449664177d1efa2b45fa75ad8f833067fe6 (diff)
downloadsquashfs-tools-1931723ba8788fc58882550c16d367375fd245e5.tar.gz
Whoops, one too many eliminated goto. We need this goto as we need
to kfree(dire), best to do this all in one place. Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>
Diffstat (limited to 'kernel/fs')
-rw-r--r--kernel/fs/squashfs/namei.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/kernel/fs/squashfs/namei.c b/kernel/fs/squashfs/namei.c
index aa28c46..fcc4915 100644
--- a/kernel/fs/squashfs/namei.c
+++ b/kernel/fs/squashfs/namei.c
@@ -153,8 +153,10 @@ static struct dentry *squashfs_lookup(struct inode *dir, struct dentry *dentry,
return ERR_PTR(-ENOMEM);
}
- if (len > SQUASHFS_NAME_LEN)
- return ERR_PTR(-ENAMETOOLONG);
+ if (len > SQUASHFS_NAME_LEN) {
+ err = -ENAMETOOLONG;
+ goto failed;
+ }
length = get_dir_index_using_name(dir->i_sb, &block, &offset,
SQUASHFS_I(dir)->dir_idx_start,
@@ -208,8 +210,10 @@ static struct dentry *squashfs_lookup(struct inode *dir, struct dentry *dentry,
blk, off, ino_num);
inode = squashfs_iget(dir->i_sb, ino, ino_num);
- if (IS_ERR(inode))
- return ERR_CAST(inode);
+ if (IS_ERR(inode)) {
+ err = PTR_ERR(inode);
+ goto failed;
+ }
goto exit_lookup;
}
@@ -227,6 +231,8 @@ read_failure:
ERROR("Unable to read directory block [%llx:%x]\n",
SQUASHFS_I(dir)->start + msblk->directory_table,
SQUASHFS_I(dir)->offset);
+failed:
+ kfree(dire);
return ERR_PTR(err);
}