Skip to content

Commit

Permalink
partitions/efi.c: replace useless kzalloc's by kmalloc's
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Matt Domsch <[email protected]>
Cc: Panagiotis Issaris <[email protected]>
Cc: Andrew Morton <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
phdm authored and axboe committed Apr 30, 2013
1 parent 6f8f5c2 commit ea56505
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions block/partitions/efi.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ static gpt_entry *alloc_read_gpt_entries(struct parsed_partitions *state,
le32_to_cpu(gpt->sizeof_partition_entry);
if (!count)
return NULL;
pte = kzalloc(count, GFP_KERNEL);
pte = kmalloc(count, GFP_KERNEL);
if (!pte)
return NULL;

Expand Down Expand Up @@ -267,7 +267,7 @@ static gpt_header *alloc_read_gpt_header(struct parsed_partitions *state,
gpt_header *gpt;
unsigned ssz = bdev_logical_block_size(state->bdev);

gpt = kzalloc(ssz, GFP_KERNEL);
gpt = kmalloc(ssz, GFP_KERNEL);
if (!gpt)
return NULL;

Expand Down

0 comments on commit ea56505

Please sign in to comment.