9p/xen: Fix end of loop tests for list_for_each_entry
authorHarshvardhan Jha <harshvardhan.jha@oracle.com>
Tue, 27 Jul 2021 00:07:10 +0000 (05:37 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 18 Sep 2021 11:40:06 +0000 (13:40 +0200)
commitc37085d606349bd312903d1957d174ca52503cf8
tree9ec6332365eeb7ed096bd5713e54cbad9e2bd675
parent907944851aa0615f1a1ccaf0b9ba499d11e26eee
9p/xen: Fix end of loop tests for list_for_each_entry

commit 732b33d0dbf17e9483f0b50385bf606f724f50a2 upstream.

This patch addresses the following problems:
 - priv can never be NULL, so this part of the check is useless
 - if the loop ran through the whole list, priv->client is invalid and
it is more appropriate and sufficient to check for the end of
list_for_each_entry loop condition.

Link: http://lkml.kernel.org/r/20210727000709.225032-1-harshvardhan.jha@oracle.com
Signed-off-by: Harshvardhan Jha <harshvardhan.jha@oracle.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Tested-by: Stefano Stabellini <sstabellini@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/9p/trans_xen.c