Skip to content

Commit ea56505

Browse files
phdmaxboe
authored andcommitted
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>
1 parent 6f8f5c2 commit ea56505

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎block/partitions/efi.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ static gpt_entry *alloc_read_gpt_entries(struct parsed_partitions *state,
238238
le32_to_cpu(gpt->sizeof_partition_entry);
239239
if (!count)
240240
return NULL;
241-
pte = kzalloc(count, GFP_KERNEL);
241+
pte = kmalloc(count, GFP_KERNEL);
242242
if (!pte)
243243
return NULL;
244244

@@ -267,7 +267,7 @@ static gpt_header *alloc_read_gpt_header(struct parsed_partitions *state,
267267
gpt_header *gpt;
268268
unsigned ssz = bdev_logical_block_size(state->bdev);
269269

270-
gpt = kzalloc(ssz, GFP_KERNEL);
270+
gpt = kmalloc(ssz, GFP_KERNEL);
271271
if (!gpt)
272272
return NULL;
273273

0 commit comments

Comments
 (0)