diff options
author | Philippe De Muyter <phdm@macqel.be> | 2013-04-29 17:00:18 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2013-04-30 02:34:25 -0400 |
commit | ea56505bedd03e21f497c59cece15a62b4398fc4 (patch) | |
tree | b5313d5052f0bae246fda92f00f804319dd6022f /block | |
parent | 6f8f5c260af67fed49fe14efc3ad1f69654c260e (diff) |
partitions/efi.c: replace useless kzalloc's by kmalloc's
In alloc_read_gpt_entries and alloc_read_gpt_header, the kzalloc'ated
zones are either totally overwritten by the following read_lba call,
or freed. As kmalloc is cheaper than kzalloc, use kmalloc.
Signed-off-by: Philippe De Muyter <phdm@macqel.be>
Cc: Matt Domsch <Matt_Domsch@dell.com>
Cc: Panagiotis Issaris <takis@issaris.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r-- | block/partitions/efi.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/block/partitions/efi.c b/block/partitions/efi.c index ff5804e2f1d2..c85fc895ecdb 100644 --- a/block/partitions/efi.c +++ b/block/partitions/efi.c | |||
@@ -238,7 +238,7 @@ static gpt_entry *alloc_read_gpt_entries(struct parsed_partitions *state, | |||
238 | le32_to_cpu(gpt->sizeof_partition_entry); | 238 | le32_to_cpu(gpt->sizeof_partition_entry); |
239 | if (!count) | 239 | if (!count) |
240 | return NULL; | 240 | return NULL; |
241 | pte = kzalloc(count, GFP_KERNEL); | 241 | pte = kmalloc(count, GFP_KERNEL); |
242 | if (!pte) | 242 | if (!pte) |
243 | return NULL; | 243 | return NULL; |
244 | 244 | ||
@@ -267,7 +267,7 @@ static gpt_header *alloc_read_gpt_header(struct parsed_partitions *state, | |||
267 | gpt_header *gpt; | 267 | gpt_header *gpt; |
268 | unsigned ssz = bdev_logical_block_size(state->bdev); | 268 | unsigned ssz = bdev_logical_block_size(state->bdev); |
269 | 269 | ||
270 | gpt = kzalloc(ssz, GFP_KERNEL); | 270 | gpt = kmalloc(ssz, GFP_KERNEL); |
271 | if (!gpt) | 271 | if (!gpt) |
272 | return NULL; | 272 | return NULL; |
273 | 273 | ||