Skip to content

Commit 93e530d

Browse files
elic307imstsirkin
authored andcommitted
vdpa/mlx5: Fix possible uninitialized return value
Initialize err local variable to return -EAGAIN if the asid cannot be found thus avoiding returning uninitialized value. Fixes: 8fcd20c ("vdpa/mlx5: Support different address spaces for control and data") Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Eli Cohen <[email protected]> Message-Id: <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]>
1 parent 4a44a5e commit 93e530d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/vdpa/mlx5/net/mlx5_vnet.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2659,7 +2659,7 @@ static int mlx5_vdpa_set_map(struct vdpa_device *vdev, unsigned int asid,
26592659
{
26602660
struct mlx5_vdpa_dev *mvdev = to_mvdev(vdev);
26612661
struct mlx5_vdpa_net *ndev = to_mlx5_vdpa_ndev(mvdev);
2662-
int err;
2662+
int err = -EINVAL;
26632663

26642664
down_write(&ndev->reslock);
26652665
if (mvdev->group2asid[MLX5_VDPA_DATAVQ_GROUP] == asid) {

0 commit comments

Comments
 (0)