Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
virtio-iommu: Remove useless !sdev check in virtio_iommu_probe()
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: 09b4c3d ("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>
  • Loading branch information
eauger authored and mstsirkin committed Dec 2, 2023
1 parent c04cfb4 commit c8559fc
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions hw/virtio/virtio-iommu.c
Expand Up @@ -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) {
Expand Down

0 comments on commit c8559fc

Please sign in to comment.