Skip to content

Commit ac2efaa

Browse files
ethancedwards8ardbiesheuvel
authored andcommitted
efi: efibc: change kmalloc(size * count, ...) to kmalloc_array()
Open coded arithmetic in allocator arguments is discouraged. Helper functions like kcalloc or, in this case, kmalloc_array are preferred. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments Signed-off-by: Ethan Carter Edwards <ethan@ethancedwards.com> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
1 parent b6b227e commit ac2efaa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/firmware/efi/efibc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static int efibc_reboot_notifier_call(struct notifier_block *notifier,
4747
if (ret || !data)
4848
return NOTIFY_DONE;
4949

50-
wdata = kmalloc(MAX_DATA_LEN * sizeof(efi_char16_t), GFP_KERNEL);
50+
wdata = kmalloc_array(MAX_DATA_LEN, sizeof(efi_char16_t), GFP_KERNEL);
5151
if (!wdata)
5252
return NOTIFY_DONE;
5353

0 commit comments

Comments
 (0)