]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
pm: cpupower: bench: Prevent NULL dereference on malloc failure
authorZhongqiu Han <quic_zhonhan@quicinc.com>
Wed, 19 Feb 2025 12:27:15 +0000 (20:27 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 May 2025 05:43:53 +0000 (07:43 +0200)
commit0e297a02e03dceb2874789ca40bd4e65c5371704
treec4f83dc5d7c407a250cc68d303048cfc15e21015
parentc2077a80caf2e65b0382c6d3a9db20e63a90f255
pm: cpupower: bench: Prevent NULL dereference on malloc failure

[ Upstream commit 208baa3ec9043a664d9acfb8174b332e6b17fb69 ]

If malloc returns NULL due to low memory, 'config' pointer can be NULL.
Add a check to prevent NULL dereference.

Link: https://lore.kernel.org/r/20250219122715.3892223-1-quic_zhonhan@quicinc.com
Signed-off-by: Zhongqiu Han <quic_zhonhan@quicinc.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/power/cpupower/bench/parse.c