diff options
author | Phillip Lougher <phillip@lougher.demon.co.uk> | 2011-05-20 03:26:43 +0200 |
---|---|---|
committer | Phillip Lougher <phillip@lougher.demon.co.uk> | 2011-05-25 19:21:31 +0200 |
commit | 82de647e1f81fd89afc48608d889dd3b33cb8983 (patch) | |
tree | 847b7b40ed273eaa755c27bef6b1a20d201273c2 /fs/squashfs/id.c | |
parent | Squashfs: Use vmalloc rather than kmalloc for zlib workspace (diff) | |
download | linux-82de647e1f81fd89afc48608d889dd3b33cb8983.tar.xz linux-82de647e1f81fd89afc48608d889dd3b33cb8983.zip |
Squashfs: move table allocation into squashfs_read_table()
This eliminates a lot of duplicate code.
Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>
Diffstat (limited to 'fs/squashfs/id.c')
-rw-r--r-- | fs/squashfs/id.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/fs/squashfs/id.c b/fs/squashfs/id.c index d8f32452638e..2fdac6703b48 100644 --- a/fs/squashfs/id.c +++ b/fs/squashfs/id.c @@ -69,24 +69,8 @@ __le64 *squashfs_read_id_index_table(struct super_block *sb, u64 id_table_start, unsigned short no_ids) { unsigned int length = SQUASHFS_ID_BLOCK_BYTES(no_ids); - __le64 *id_table; - int err; TRACE("In read_id_index_table, length %d\n", length); - /* Allocate id lookup table indexes */ - id_table = kmalloc(length, GFP_KERNEL); - if (id_table == NULL) { - ERROR("Failed to allocate id index table\n"); - return ERR_PTR(-ENOMEM); - } - - err = squashfs_read_table(sb, id_table, id_table_start, length); - if (err < 0) { - ERROR("unable to read id index table\n"); - kfree(id_table); - return ERR_PTR(err); - } - - return id_table; + return squashfs_read_table(sb, id_table_start, length); } |