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 AAFB73939CC for ; Mon, 9 Mar 2026 11:24:48 +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=1773055488; cv=none; b=ntfd923wl99CL+LJS6IRZl2o0pmW634/APMFZvfF7iuXxD7bUYgvBxADhTAh9V3QFRJX+chsO4UD+FCHIg2VU0LVJHoGaNExBav/L00ktcLEjUD0xOkpv60Whdyz5K8FCza7yB3p7VRjuA4kuydRERdy2Ceh4COrb7CyLkoFBds= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773055488; c=relaxed/simple; bh=gkkz/ghM5Yu2Efgw9MaceX1hCerU1wjenqODJua1y9E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=mpMif1m5YKmyL6KmXmdszTcD2B6FACa5a3AARodV72dXjSD9rYxOfe5CMTBUYsbtQxnw8Z5dHDYZGH7NdwdnjVaWMdWoqn5HJ3eiSaUJE6tWqJNcHIEKb1ypeMVhvYzl9GMVY/ASVGajctXifILQfgiDvJgJmsbaqiDFjFVyPkk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LDD6XJHp; 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="LDD6XJHp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 95C7CC2BC87; Mon, 9 Mar 2026 11:24:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773055488; bh=gkkz/ghM5Yu2Efgw9MaceX1hCerU1wjenqODJua1y9E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LDD6XJHpxvooaF9mH1a7YRnX3jF48xuZ4bUjbdAYojXMUfIEcFc3/Utbd90/sLYRB A3ScL72EPd7BPPu5CxzhQTzQ+WO5UfrZcN1L/kQfiw/cl9xh3pDfQI59ExByZNxDRQ cnK3cMwO91ih/uy3Cgp1egvapsNUWJOWJsRXzHIRK81LPwCdYW6jFkv/slEzHrf19J hwdbXuyrX/4sccJmHA5EPTwX2bg6ToAhLJ2yUydkWhlp2KvAQczSXI872mvPy8TuKp sjJNVtGlm00aLzrsj6YIkoDeq6/Ykb3D+hVspuvZZvzv7ypTZ/Vezoq4bbHpt24BUq 49UH5XRm1ZsmA== 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.18.y] platform/x86: hp-bioscfg: Support allocations of larger data Date: Mon, 9 Mar 2026 07:24:45 -0400 Message-ID: <20260309112445.817434-1-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <2026030929-aground-facility-67d7@gregkh> References: <2026030929-aground-facility-67d7@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