[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210517093428.670-7-xieyongji@bytedance.com>
Date: Mon, 17 May 2021 17:34:19 +0800
From: Xie Yongji <xieyongji@...edance.com>
To: mst@...hat.com, jasowang@...hat.com, stefanha@...hat.com
Cc: amit@...nel.org, arei.gonglei@...wei.com, airlied@...ux.ie,
kraxel@...hat.com, jean-philippe@...aro.org, ohad@...ery.com,
bjorn.andersson@...aro.org, david@...hat.com, vgoyal@...hat.com,
miklos@...redi.hu, lucho@...kov.net, asmadeus@...ewreck.org,
virtualization@...ts.linux-foundation.org,
linux-kernel@...r.kernel.org
Subject: [RFC PATCH 06/15] virtio-iommu: Handle virtio_device_ready() failure
Now virtio_device_ready() will return error if we get
invalid status. Let's handle this case on probe.
Signed-off-by: Xie Yongji <xieyongji@...edance.com>
---
drivers/iommu/virtio-iommu.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/iommu/virtio-iommu.c b/drivers/iommu/virtio-iommu.c
index 2bfdd5734844..0d4840c5841a 100644
--- a/drivers/iommu/virtio-iommu.c
+++ b/drivers/iommu/virtio-iommu.c
@@ -1053,7 +1053,9 @@ static int viommu_probe(struct virtio_device *vdev)
viommu_ops.pgsize_bitmap = viommu->pgsize_bitmap;
- virtio_device_ready(vdev);
+ ret = virtio_device_ready(vdev);
+ if (ret)
+ goto err_free_vqs;
/* Populate the event queue with buffers */
ret = viommu_fill_evtq(viommu);
--
2.11.0
Powered by blists - more mailing lists