diff options
author | Ethan Carter Edwards <ethan@ethancedwards.com> | 2025-03-09 04:27:41 +0300 |
---|---|---|
committer | Ard Biesheuvel <ardb@kernel.org> | 2025-03-10 20:22:47 +0300 |
commit | ac2efaa8455021ce1e6216457684d60a9e2c77fd (patch) | |
tree | 243e4495a6b9201d1a1ab9479a6e4c1553385929 | |
parent | b6b227e36b5ad878260f5a3a1838f2d79d5e68e9 (diff) | |
download | linux-ac2efaa8455021ce1e6216457684d60a9e2c77fd.tar.xz |
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>
-rw-r--r-- | drivers/firmware/efi/efibc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/firmware/efi/efibc.c b/drivers/firmware/efi/efibc.c index 4f9fb086eab7..0a7c764dcc61 100644 --- a/drivers/firmware/efi/efibc.c +++ b/drivers/firmware/efi/efibc.c @@ -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; |