diff options
author | Xiaomeng Tong <[email protected]> | 2022-03-27 13:57:33 +0800 |
---|---|---|
committer | Will Deacon <[email protected]> | 2022-04-04 10:50:02 +0100 |
commit | 2012a9e279013933885983cbe0a5fe828052563b (patch) | |
tree | 8996fa1ac5b3a3b615dcf9bc5c42af1bead87836 /lib/mpi/mpi-cmp.c | |
parent | 4dfa1f3657a0d4fb556d4440322d35bdcf5e4970 (diff) |
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: 21bdbb7102ed ("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]>
Diffstat (limited to 'lib/mpi/mpi-cmp.c')
0 files changed, 0 insertions, 0 deletions