Commit 00932a98 authored by Jakob Koschel's avatar Jakob Koschel Committed by Zheng Zengkai
Browse files

powerpc/sysdev: fix incorrect use to determine if list is empty

stable inclusion
from stable-v5.10.110
commit bcf93175ed84ead43bafed9722cd488d2b13b8cb
bugzilla: https://gitee.com/openeuler/kernel/issues/I574AL

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=bcf93175ed84ead43bafed9722cd488d2b13b8cb



--------------------------------

[ Upstream commit fa1321b1 ]

'gtm' will *always* be set by list_for_each_entry().
It is incorrect to assume that the iterator value will be NULL if the
list is empty.

Instead of checking the pointer it should be checked if
the list is empty.

Fixes: 83ff9dcf ("powerpc/sysdev: implement FSL GTM support")
Signed-off-by: default avatarJakob Koschel <jakobkoschel@gmail.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220228142434.576226-1-jakobkoschel@gmail.com


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarYu Liao <liaoyu15@huawei.com>
Reviewed-by: default avatarWei Li <liwei391@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent df75eeb9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment