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
..
arm_pmu.c
arm_pmu_acpi.c drivers/perf: arm_pmu_acpi: Fix incorrect checking of gicc pointer 2020-04-02 16:34:14 +02:00
arm_pmu_platform.c perf/arm_pmu_platform: Fix error handling 2021-05-22 10:57:17 +02:00
Kconfig
Makefile
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 drivers/perf: xgene_pmu: Fix uninitialized resource struct 2020-10-29 09:07:00 +01:00