]> www.infradead.org Git - users/jedix/linux-maple.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)
committerShuah Khan <skhan@linuxfoundation.org>
Wed, 19 Feb 2025 20:48:08 +0000 (13:48 -0700)
commit208baa3ec9043a664d9acfb8174b332e6b17fb69
treeba2a120607d62152e75c8e36aa760c7110a2dc59
parenta64dcfb451e254085a7daee5fe51bf22959d52d3
pm: cpupower: bench: Prevent NULL dereference on malloc failure

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>
tools/power/cpupower/bench/parse.c