Dan Carpenter
2022-Aug-11 10:39 UTC
[bug report] vdpa/mlx5: Support different address spaces for control and data
Hello Eli Cohen, The patch d5358cd0e369: "vdpa/mlx5: Support different address spaces for control and data" from Jul 14, 2022, leads to the following Smatch static checker warning: drivers/vdpa/mlx5/net/mlx5_vnet.c:2676 mlx5_vdpa_set_map() error: uninitialized symbol 'err'. drivers/vdpa/mlx5/net/mlx5_vnet.c 2657 static int mlx5_vdpa_set_map(struct vdpa_device *vdev, unsigned int asid, 2658 struct vhost_iotlb *iotlb) 2659 { 2660 struct mlx5_vdpa_dev *mvdev = to_mvdev(vdev); 2661 struct mlx5_vdpa_net *ndev = to_mlx5_vdpa_ndev(mvdev); 2662 int err; 2663 2664 down_write(&ndev->reslock); 2665 if (mvdev->group2asid[MLX5_VDPA_DATAVQ_GROUP] == asid) { 2666 err = set_map_data(mvdev, iotlb); 2667 if (err) 2668 goto out; 2669 } 2670 2671 if (mvdev->group2asid[MLX5_VDPA_CVQ_GROUP] == asid) 2672 err = set_map_control(mvdev, iotlb); err not initialized on else path. My guess is that one or both of these conditions has to be true and this is a false positive but I don't know the code well enough to be sure. 2673 2674 out: 2675 up_write(&ndev->reslock); --> 2676 return err; 2677 } regards, dan carpenter