mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-27 12:21:22 -05:00
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>
This commit is contained in:
committed by
Ard Biesheuvel
parent
b6b227e36b
commit
ac2efaa845
@@ -47,7 +47,7 @@ static int efibc_reboot_notifier_call(struct notifier_block *notifier,
|
||||
if (ret || !data)
|
||||
return NOTIFY_DONE;
|
||||
|
||||
wdata = kmalloc(MAX_DATA_LEN * sizeof(efi_char16_t), GFP_KERNEL);
|
||||
wdata = kmalloc_array(MAX_DATA_LEN, sizeof(efi_char16_t), GFP_KERNEL);
|
||||
if (!wdata)
|
||||
return NOTIFY_DONE;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user