aboutsummaryrefslogtreecommitdiffstats
path: root/fs/squashfs/fragment.c
diff options
context:
space:
mode:
authorPhillip Lougher <phillip@lougher.demon.co.uk>2011-05-19 21:26:43 -0400
committerPhillip Lougher <phillip@lougher.demon.co.uk>2011-05-25 13:21:31 -0400
commit82de647e1f81fd89afc48608d889dd3b33cb8983 (patch)
tree847b7b40ed273eaa755c27bef6b1a20d201273c2 /fs/squashfs/fragment.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/fragment.c')
-rw-r--r--fs/squashfs/fragment.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/fs/squashfs/fragment.c b/fs/squashfs/fragment.c
index 7eef571443c6..567093db5870 100644
--- a/fs/squashfs/fragment.c
+++ b/fs/squashfs/fragment.c
@@ -74,23 +74,6 @@ __le64 *squashfs_read_fragment_index_table(struct super_block *sb,
74 u64 fragment_table_start, unsigned int fragments) 74 u64 fragment_table_start, unsigned int fragments)
75{ 75{
76 unsigned int length = SQUASHFS_FRAGMENT_INDEX_BYTES(fragments); 76 unsigned int length = SQUASHFS_FRAGMENT_INDEX_BYTES(fragments);
77 __le64 *fragment_index;
78 int err;
79 77
80 /* Allocate fragment lookup table indexes */ 78 return squashfs_read_table(sb, fragment_table_start, length);
81 fragment_index = kmalloc(length, GFP_KERNEL);
82 if (fragment_index == NULL) {
83 ERROR("Failed to allocate fragment index table\n");
84 return ERR_PTR(-ENOMEM);
85 }
86
87 err = squashfs_read_table(sb, fragment_index, fragment_table_start,
88 length);
89 if (err < 0) {
90 ERROR("unable to read fragment index table\n");
91 kfree(fragment_index);
92 return ERR_PTR(err);
93 }
94
95 return fragment_index;
96} 79}