vdpa/mlx5: Fix possible failure in umem size calculation
authorEli Cohen <elic@nvidia.com>
Sun, 30 May 2021 09:03:49 +0000 (12:03 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 Jul 2021 14:05:52 +0000 (16:05 +0200)
commit8795692f0d6ca1e119c608f2706c456a0f6abdab
tree6f5e439fb5acbfa417fa1c393f253a78396f9f3f
parent63272b1ffdb097397f90ae3b5deafa5d449b57a9
vdpa/mlx5: Fix possible failure in umem size calculation

[ Upstream commit 71ab6a7cfbae27f86a3901daab10bfe13b3a1e3a ]

umem size is a 32 bit unsigned value so assigning it to an int could
cause false failures. Set the calculated value inside the function and
modify function name to reflect the fact it updates the size.

This bug was found during code review but never had real impact to this
date.

Fixes: 1a86b377aa21 ("vdpa/mlx5: Add VDPA driver for supported mlx5 devices")
Signed-off-by: Eli Cohen <elic@nvidia.com>
Link: https://lore.kernel.org/r/20210530090349.8360-1-elic@nvidia.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/vdpa/mlx5/net/mlx5_vnet.c