Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: qcom_l2_pmu: fix an incorrect NULL check on list iterator
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: [email protected] Fixes: 21bdbb7 ("perf: add qcom l2 cache perf events driver") Signed-off-by: Xiaomeng Tong <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
- Loading branch information