qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] virtio-iommu: Remove useless !sdev check in virtio_iommu_probe()
@ 2023-11-09 17:07 Eric Auger
  2023-11-09 17:11 ` Peter Maydell
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Auger @ 2023-11-09 17:07 UTC (permalink / raw)
  To: eric.auger.pro, eric.auger, qemu-devel, qemu-arm, peter.maydell
  Cc: clg, mst, yanghliu, alex.williamson

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)
---
 hw/virtio/virtio-iommu.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/hw/virtio/virtio-iommu.c b/hw/virtio/virtio-iommu.c
index 89fb5767d1..9d463efc52 100644
--- a/hw/virtio/virtio-iommu.c
+++ b/hw/virtio/virtio-iommu.c
@@ -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) {
-- 
2.41.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] virtio-iommu: Remove useless !sdev check in virtio_iommu_probe()
  2023-11-09 17:07 [PATCH] virtio-iommu: Remove useless !sdev check in virtio_iommu_probe() Eric Auger
@ 2023-11-09 17:11 ` Peter Maydell
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Maydell @ 2023-11-09 17:11 UTC (permalink / raw)
  To: Eric Auger
  Cc: eric.auger.pro, qemu-devel, qemu-arm, clg, mst, yanghliu,
	alex.williamson

On Thu, 9 Nov 2023 at 17:07, Eric Auger <eric.auger@redhat.com> wrote:
>
> 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)

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-11-09 17:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-09 17:07 [PATCH] virtio-iommu: Remove useless !sdev check in virtio_iommu_probe() Eric Auger
2023-11-09 17:11 ` Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).