From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7FBC0248873 for ; Mon, 9 Mar 2026 11:31:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773055917; cv=none; b=UWEUUbY6fCEr/52VjPuBimF2Vda7OVwfbHC/tWSK39fU5+FUD9swdGj8WXMyAYMv3hyVH+1j3t7OfRy2Ew/JrO8MXn+Y95RtAltnq0spNJtYnm31ixTbDHf8KREwyqDSN8A9Ur1Q1/XzSUygIbqjRyvRWtgvi50xNhMizTg8I1g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773055917; c=relaxed/simple; bh=gkkz/ghM5Yu2Efgw9MaceX1hCerU1wjenqODJua1y9E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=RQePePnN2fSMTUOKB9VkjPdlVLlPbJL2oig/0LlpaPuG4uYtfDKbCw7FDg2iGy6s2UYmdUKyRpzZPezGmVIei67mKs+/XewFC7wjbIpk9/bLr0WSUMS1vtFyx/zKs5vwH7CTA/vhetQtQeP97vOVHNU33V9k2aFc+1r0hW5rl3E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QcKL8X4c; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="QcKL8X4c" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 72CBFC4CEF7; Mon, 9 Mar 2026 11:31:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773055917; bh=gkkz/ghM5Yu2Efgw9MaceX1hCerU1wjenqODJua1y9E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QcKL8X4cmXk3dwMyY4DX82tnJIFW6mvWzszcvkvcdqpIpcKQIm97vKTrLv6RcTUgK CDaUfkLzWhl+beywd5SEzzVg+GvskMTUVmkcAr3dkwpCxkYnsbBBjjuFQirK51KFhb 47cRDjxawK6RG0VeWAk3WGmVa89WKcPE7Mwq8TuHNnE7vKgQ8RxZXBiO8nCkOwiGz3 f2dG2vXh8qsUMCH37mpvHX4ubtE/7URhiKrMcAFcWFgo+IyIeUxG1wzjXEv80udGwX 8qx7Y+Go2lseVWaWYPQUGfk9cHVKcOSHsR0IbSZ0ujpnZGVTsHfrTK72Z8NbwO1Gv8 Lbcm18mNoxibA== From: Sasha Levin To: stable@vger.kernel.org Cc: Mario Limonciello , Paul Kerry , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Sasha Levin Subject: [PATCH 6.12.y] platform/x86: hp-bioscfg: Support allocations of larger data Date: Mon, 9 Mar 2026 07:31:54 -0400 Message-ID: <20260309113154.820752-1-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <2026030929-deepen-powwow-6468@gregkh> References: <2026030929-deepen-powwow-6468@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Mario Limonciello [ Upstream commit 916727cfdb72cd01fef3fa6746e648f8cb70e713 ] 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 Tested-by: Paul Kerry Closes: https://bugs.debian.org/1127612 Signed-off-by: Mario Limonciello Link: https://patch.msgid.link/20260225210646.59381-1-mario.limonciello@amd.com Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen [ kcalloc() => kvcalloc() ] Signed-off-by: Sasha Levin --- drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c b/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c index f346aad8e9d89..af4d1920d4880 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 = kcalloc(bioscfg_drv.enumeration_instances_count, - sizeof(*bioscfg_drv.enumeration_data), GFP_KERNEL); + 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; @@ -444,6 +447,6 @@ void hp_exit_enumeration_attributes(void) } bioscfg_drv.enumeration_instances_count = 0; - kfree(bioscfg_drv.enumeration_data); + kvfree(bioscfg_drv.enumeration_data); bioscfg_drv.enumeration_data = NULL; } -- 2.51.0