]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
powerpc/sysdev: fix incorrect use to determine if list is empty
authorJakob Koschel <jakobkoschel@gmail.com>
Mon, 28 Feb 2022 14:24:33 +0000 (15:24 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Apr 2022 12:14:50 +0000 (14:14 +0200)
commit580d8f612048b682b3a898dcd22e097293fecea7
tree68e1982639e41858d1f761382a558716d6def609
parentb09700574652d0e9cf0b3b35e48ca542e9830255
powerpc/sysdev: fix incorrect use to determine if list is empty

[ Upstream commit fa1321b11bd01752f5be2415e74a0e1a7c378262 ]

'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: 83ff9dcf375c ("powerpc/sysdev: implement FSL GTM support")
Signed-off-by: Jakob Koschel <jakobkoschel@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220228142434.576226-1-jakobkoschel@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/powerpc/sysdev/fsl_gtm.c