9p/xen: fix check for xenbus_read error in front_probe
authorDominique Martinet <dominique.martinet@cea.fr>
Tue, 14 Aug 2018 02:43:48 +0000 (02:43 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Jul 2019 11:15:58 +0000 (13:15 +0200)
commit26b3b1dbb3954edd26665890ee4ca785fb5f6ffa
treeaa4b5abd8017bed03c29aeaf2f45ee4dd582250b
parentff325dc466cc4bf77f03abf0763e395b45102c61
9p/xen: fix check for xenbus_read error in front_probe

[ Upstream commit 2f9ad0ac947ccbe3ffe7c6229c9330f2a7755f64 ]

If the xen bus exists but does not expose the proper interface, it is
possible to get a non-zero length but still some error, leading to
strcmp failing trying to load invalid memory addresses e.g.
fffffffffffffffe.

There is then no need to check length when there is no error, as the
xenbus driver guarantees that the string is nul-terminated.

Link: http://lkml.kernel.org/r/1534236007-10170-1-git-send-email-asmadeus@codewreck.org
Signed-off-by: Dominique Martinet <dominique.martinet@cea.fr>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Cc: Eric Van Hensbergen <ericvh@gmail.com>
Cc: Latchesar Ionkov <lucho@ionkov.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/9p/trans_xen.c