xen/xenbus: let xenbus_map_ring_valloc() return errno values only
authorJuergen Gross <jgross@suse.com>
Wed, 1 Jul 2020 12:16:38 +0000 (14:16 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Jul 2020 07:34:01 +0000 (09:34 +0200)
commitf4d6ffaeb30836ac90e7686de2e8ec80e9316450
tree0aeb8cf86f628e52879dfd58a278a9f8f1c995e7
parent41b016e0f6595b118b0c8b393257a8d3c093a9af
xen/xenbus: let xenbus_map_ring_valloc() return errno values only

[ Upstream commit 578c1bb9056263ad3c9e09746b3d6e4daf63bdb0 ]

Today xenbus_map_ring_valloc() can return either a negative errno
value (-ENOMEM or -EINVAL) or a grant status value. This is a mess as
e.g -ENOMEM and GNTST_eagain have the same numeric value.

Fix that by turning all grant mapping errors into -ENOENT. This is
no problem as all callers of xenbus_map_ring_valloc() only use the
return value to print an error message, and in case of mapping errors
the grant status value has already been printed by __xenbus_map_ring()
before.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Link: https://lore.kernel.org/r/20200701121638.19840-3-jgross@suse.com
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/xen/xenbus/xenbus_client.c