]> git.proxmox.com Git - mirror_qemu.git/commitdiff
virtio-iommu: Remove useless !sdev check in virtio_iommu_probe()
authorEric Auger <eric.auger@redhat.com>
Thu, 9 Nov 2023 17:07:15 +0000 (18:07 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Sat, 2 Dec 2023 20:56:49 +0000 (15:56 -0500)
The code already checks iommu_mr is not NULL so there is no
need to check container_of() is not NULL. Remove the check.

Fixes: CID 1523901
Fixes: 09b4c3d6a2 ("virtio-iommu: Record whether a probe request has
been issued")
Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reported-by: Coverity (CID 1523901)
Message-Id: <20231109170715.259520-1-eric.auger@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/virtio/virtio-iommu.c

index 89fb5767d13ffc14d0261cc43aa16346fcad0ec8..9d463efc52a7cf69cfd1d256ecaf907e8068a467 100644 (file)
@@ -698,9 +698,6 @@ static int virtio_iommu_probe(VirtIOIOMMU *s,
     }
 
     sdev = container_of(iommu_mr, IOMMUDevice, iommu_mr);
-    if (!sdev) {
-        return -EINVAL;
-    }
 
     count = virtio_iommu_fill_resv_mem_prop(sdev, ep_id, buf, free);
     if (count < 0) {