]> 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>
Sun, 20 Apr 2025 08:15:10 +0000 (10:15 +0200)
commitf8d28fa305b78c5d1073b63f26db265ba8291ae1
tree4b61e7f8adbaddcb42a1f476a3d22d3ccad24dda
parent67e85cfa951cb074dabd9ec5ef11b74e78cb5a06
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