Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

platform/x86: hp-bioscfg: Support allocations of larger data

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>
Tested-by: Paul Kerry <p.kerry@sheffield.ac.uk>
Closes: https://bugs.debian.org/1127612
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://patch.msgid.link/20260225210646.59381-1-mario.limonciello@amd.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

authored by

Mario Limonciello and committed by
Ilpo Järvinen
916727cf cd088305

+6 -3
+6 -3
drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c
··· 94 94 bioscfg_drv.enumeration_instances_count = 95 95 hp_get_instance_count(HP_WMI_BIOS_ENUMERATION_GUID); 96 96 97 - bioscfg_drv.enumeration_data = kzalloc_objs(*bioscfg_drv.enumeration_data, 98 - bioscfg_drv.enumeration_instances_count); 97 + if (!bioscfg_drv.enumeration_instances_count) 98 + return -EINVAL; 99 + bioscfg_drv.enumeration_data = kvcalloc(bioscfg_drv.enumeration_instances_count, 100 + sizeof(*bioscfg_drv.enumeration_data), GFP_KERNEL); 101 + 99 102 if (!bioscfg_drv.enumeration_data) { 100 103 bioscfg_drv.enumeration_instances_count = 0; 101 104 return -ENOMEM; ··· 447 444 } 448 445 bioscfg_drv.enumeration_instances_count = 0; 449 446 450 - kfree(bioscfg_drv.enumeration_data); 447 + kvfree(bioscfg_drv.enumeration_data); 451 448 bioscfg_drv.enumeration_data = NULL; 452 449 }