summaryrefslogtreecommitdiffstats
path: root/fs/squashfs/id.c
diff options
context:
space:
mode:
authorPhillip Lougher <phillip@lougher.demon.co.uk>2011-05-20 02:26:43 +0100
committerPhillip Lougher <phillip@lougher.demon.co.uk>2011-05-25 18:21:31 +0100
commit82de647e1f81fd89afc48608d889dd3b33cb8983 (patch)
tree847b7b40ed273eaa755c27bef6b1a20d201273c2 /fs/squashfs/id.c
parent117a91e0f25fd7698e20ac3dfa62086be3dc82a3 (diff)
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.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/fs/squashfs/id.c b/fs/squashfs/id.c
index d8f32452638..2fdac6703b4 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);
}