[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Minios-devel] [UNIKRAFT PATCH] plat/virtio: Fix virtio-bus init getting hanged



Hello Cristian Banu,

This patch looks good. Thanks for the bug fix

Reviewed-by: Sharan Santhanam <sharan.santhanam@xxxxxxxxx>

Thanks & Regards
Sharan

On 12/05/2018 03:27 PM, Cristian Banu wrote:
This patch fixes getting hanged in virtio-bus initialization. The inner
while loop does not iterate through all the dev_ids, and failing to find
a match against the first dev_id results in an infinite loop.

Signed-off-by: Cristian Banu <cristb@xxxxxxxxx>
---
  plat/drivers/virtio/virtio_bus.c | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/plat/drivers/virtio/virtio_bus.c b/plat/drivers/virtio/virtio_bus.c
index 48a24678ea78..3fc86ea827f6 100644
--- a/plat/drivers/virtio/virtio_bus.c
+++ b/plat/drivers/virtio/virtio_bus.c
@@ -79,11 +79,13 @@ static struct virtio_driver *find_match_drv(struct 
virtio_dev *vdev)
        struct virtio_driver *drv = NULL;
UK_TAILQ_FOREACH(drv, &virtio_drvs, next) {
+               i = 0;
                while (drv->dev_ids[i].virtio_device_id != VIRTIO_ID_INVALID) {
                        if (virtio_device_id_match(&drv->dev_ids[i],
                                                   &vdev->id)) {
                                return drv;
                        }
+                       i++;
                }
        }
        return NULL;


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.