vdpa/mlx5: Set err = -ENOMEM in case dma_map_sg_attrs fails
authorEli Cohen <elic@nvidia.com>
Sun, 11 Apr 2021 08:36:46 +0000 (11:36 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Apr 2021 11:39:59 +0000 (13:39 +0200)
commita8cd07e4400d66c3304a38c5796a41c10ad76743
tree41947bf8dbfbd1f9eacb9fa589ce14333b68cdde
parentbf84ef2dd2ccdcd8f2658476d34b51455f970ce4
vdpa/mlx5: Set err = -ENOMEM in case dma_map_sg_attrs fails

[ Upstream commit be286f84e33da1a7f83142b64dbd86f600e73363 ]

Set err = -ENOMEM if dma_map_sg_attrs() fails so the function reutrns
error.

Fixes: 94abbccdf291 ("vdpa/mlx5: Add shared memory registration code")
Signed-off-by: Eli Cohen <elic@nvidia.com>
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20210411083646.910546-1-elic@nvidia.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/vdpa/mlx5/core/mr.c