linux-stable/drivers/perf
Xiaomeng Tong 9cb434100c perf: qcom_l2_pmu: fix an incorrect NULL check on list iterator
commit 2012a9e279 upstream.

The bug is here:
	return cluster;

The list iterator value 'cluster' will *always* be set and non-NULL
by list_for_each_entry(), so it is incorrect to assume that the
iterator value will be NULL if the list is empty or no element
is found.

To fix the bug, return 'cluster' when found, otherwise return NULL.

Cc: stable@vger.kernel.org
Fixes: 21bdbb7102 ("perf: add qcom l2 cache perf events driver")
Signed-off-by: Xiaomeng Tong <xiam0nd.tong@gmail.com>
Link: https://lore.kernel.org/r/20220327055733.4070-1-xiam0nd.tong@gmail.com
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-20 09:08:30 +02:00
..
Kconfig
Makefile
arm_pmu.c
arm_pmu_acpi.c
arm_pmu_platform.c perf/arm_pmu_platform: Fix error handling 2021-05-22 10:57:17 +02:00
qcom_l2_pmu.c perf: qcom_l2_pmu: fix an incorrect NULL check on list iterator 2022-04-20 09:08:30 +02:00
qcom_l3_pmu.c
xgene_pmu.c