* [PATCH] platform/x86: hp-bioscfg: Support allocations of larger data
@ 2026-02-23 16:32 Mario Limonciello
2026-02-24 15:06 ` Mario Limonciello
2026-02-25 20:44 ` Ben Hutchings
0 siblings, 2 replies; 3+ messages in thread
From: Mario Limonciello @ 2026-02-23 16:32 UTC (permalink / raw)
To: mario.limonciello, jorge.lopez2, hansg, ilpo.jarvinen, linux
Cc: stable, Paul Kerry, platform-driver-x86
Some systems have much larger amounts of enumeration attributes
than have been previously encountered. This can lead to page allocation
failures when using kcalloc(). Switch over to using kvcalloc() to
allow larger allocations.
Fixes: 6b2770bfd6f92 ("platform/x86: hp-bioscfg: enum-attributes")
Cc: stable@vger.kernel.org
Reported-by: Paul Kerry <p.kerry@sheffield.ac.uk>
Closes: https://bugs.debian.org/1127612
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c b/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c
index 470b9f44ed7aa..af24313d078db 100644
--- a/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c
+++ b/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c
@@ -94,8 +94,11 @@ int hp_alloc_enumeration_data(void)
bioscfg_drv.enumeration_instances_count =
hp_get_instance_count(HP_WMI_BIOS_ENUMERATION_GUID);
- bioscfg_drv.enumeration_data = kzalloc_objs(*bioscfg_drv.enumeration_data,
- bioscfg_drv.enumeration_instances_count);
+ if (!bioscfg_drv.enumeration_instances_count)
+ return -EINVAL;
+ bioscfg_drv.enumeration_data = kvcalloc(bioscfg_drv.enumeration_instances_count,
+ sizeof(*bioscfg_drv.enumeration_data), GFP_KERNEL);
+
if (!bioscfg_drv.enumeration_data) {
bioscfg_drv.enumeration_instances_count = 0;
return -ENOMEM;
--
2.53.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] platform/x86: hp-bioscfg: Support allocations of larger data
2026-02-23 16:32 [PATCH] platform/x86: hp-bioscfg: Support allocations of larger data Mario Limonciello
@ 2026-02-24 15:06 ` Mario Limonciello
2026-02-25 20:44 ` Ben Hutchings
1 sibling, 0 replies; 3+ messages in thread
From: Mario Limonciello @ 2026-02-24 15:06 UTC (permalink / raw)
To: jorge.lopez2, hansg, ilpo.jarvinen, linux
Cc: stable, Paul Kerry, platform-driver-x86
On 2/23/2026 10:32 AM, Mario Limonciello wrote:
> Some systems have much larger amounts of enumeration attributes
> than have been previously encountered. This can lead to page allocation
> failures when using kcalloc(). Switch over to using kvcalloc() to
> allow larger allocations.
>
> Fixes: 6b2770bfd6f92 ("platform/x86: hp-bioscfg: enum-attributes")
> Cc: stable@vger.kernel.org
> Reported-by: Paul Kerry <p.kerry@sheffield.ac.uk>
> Closes: https://bugs.debian.org/1127612
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Add a tag for Paul's test
(https://lore.kernel.org/platform-driver-x86/b2535142-aaff-4eb0-87bd-34c9f8f16f07@sheffield.ac.uk/T/#m5ae303266e0685309c19c67d2e320a6d42579cd5)
Tested-by: Paul Kerry <p.kerry@sheffield.ac.uk>
> ---
> drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c b/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c
> index 470b9f44ed7aa..af24313d078db 100644
> --- a/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c
> +++ b/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c
> @@ -94,8 +94,11 @@ int hp_alloc_enumeration_data(void)
> bioscfg_drv.enumeration_instances_count =
> hp_get_instance_count(HP_WMI_BIOS_ENUMERATION_GUID);
>
> - bioscfg_drv.enumeration_data = kzalloc_objs(*bioscfg_drv.enumeration_data,
> - bioscfg_drv.enumeration_instances_count);
> + if (!bioscfg_drv.enumeration_instances_count)
> + return -EINVAL;
> + bioscfg_drv.enumeration_data = kvcalloc(bioscfg_drv.enumeration_instances_count,
> + sizeof(*bioscfg_drv.enumeration_data), GFP_KERNEL);
> +
> if (!bioscfg_drv.enumeration_data) {
> bioscfg_drv.enumeration_instances_count = 0;
> return -ENOMEM;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] platform/x86: hp-bioscfg: Support allocations of larger data
2026-02-23 16:32 [PATCH] platform/x86: hp-bioscfg: Support allocations of larger data Mario Limonciello
2026-02-24 15:06 ` Mario Limonciello
@ 2026-02-25 20:44 ` Ben Hutchings
1 sibling, 0 replies; 3+ messages in thread
From: Ben Hutchings @ 2026-02-25 20:44 UTC (permalink / raw)
To: Mario Limonciello, jorge.lopez2, hansg, ilpo.jarvinen, linux
Cc: stable, Paul Kerry, platform-driver-x86
[-- Attachment #1: Type: text/plain, Size: 1826 bytes --]
On Mon, 2026-02-23 at 10:32 -0600, Mario Limonciello wrote:
> Some systems have much larger amounts of enumeration attributes
> than have been previously encountered. This can lead to page allocation
> failures when using kcalloc(). Switch over to using kvcalloc() to
> allow larger allocations.
>
> Fixes: 6b2770bfd6f92 ("platform/x86: hp-bioscfg: enum-attributes")
> Cc: stable@vger.kernel.org
> Reported-by: Paul Kerry <p.kerry@sheffield.ac.uk>
> Closes: https://bugs.debian.org/1127612
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> ---
> drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c b/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c
> index 470b9f44ed7aa..af24313d078db 100644
> --- a/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c
> +++ b/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c
> @@ -94,8 +94,11 @@ int hp_alloc_enumeration_data(void)
> bioscfg_drv.enumeration_instances_count =
> hp_get_instance_count(HP_WMI_BIOS_ENUMERATION_GUID);
>
> - bioscfg_drv.enumeration_data = kzalloc_objs(*bioscfg_drv.enumeration_data,
> - bioscfg_drv.enumeration_instances_count);
> + if (!bioscfg_drv.enumeration_instances_count)
> + return -EINVAL;
> + bioscfg_drv.enumeration_data = kvcalloc(bioscfg_drv.enumeration_instances_count,
> + sizeof(*bioscfg_drv.enumeration_data), GFP_KERNEL);
> +
So the kfree() in hp_exit_enumeration_attributes() also needs to become
a kvfree(), right?
Ben.
> if (!bioscfg_drv.enumeration_data) {
> bioscfg_drv.enumeration_instances_count = 0;
> return -ENOMEM;
--
Ben Hutchings
Anthony's Law of Force: Don't force it, get a larger hammer.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-02-25 20:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-23 16:32 [PATCH] platform/x86: hp-bioscfg: Support allocations of larger data Mario Limonciello
2026-02-24 15:06 ` Mario Limonciello
2026-02-25 20:44 ` Ben Hutchings
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox