]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
plat/drivers/virtio: Fix virtio_9p tag read
authorXingjian Zhang <zhxj9823@qq.com>
Thu, 17 Aug 2023 13:42:54 +0000 (21:42 +0800)
committerUnikraft <monkey@unikraft.io>
Thu, 17 Aug 2023 14:36:34 +0000 (14:36 +0000)
Swap the last two arguments of virtio_9p_feature_negotiate's first
call to virtio_config_get. As per the function definition, the last
argument needs to actually be the length of the type.

Signed-off-by: Xingjian Zhang <zhxj9823@qq.com>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Reviewed-by: Sergiu Moga <sergiu@unikraft.io>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #1059

plat/drivers/virtio/virtio_9p.c

index 233cb9f575a354f4aaaef52fbeb6b920f38e9ba0..d4e9afe7e7a94e30c6ce759f341bed8d1f22bb78 100644 (file)
@@ -344,7 +344,7 @@ static int virtio_9p_feature_negotiate(struct virtio_9p_device *d)
 
        if (virtio_config_get(d->vdev,
                          __offsetof(struct virtio_9p_config, tag_len),
-                         &tag_len, 1, sizeof(tag_len)) < 0)
+                         &tag_len, sizeof(tag_len), 1) < 0)
        {
                rc = -EAGAIN;
                goto out;