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

Re: [UNIKRAFT PATCH 1/2] plat/virtio: virtio_config_get returns >= 0


  • To: Sharan Santhanam <sharan.santhanam@xxxxxxxxx>
  • From: Alexander Jung <alex@xxxxxxxxxxxx>
  • Date: Fri, 8 Jan 2021 10:30:45 +0000
  • Ai-spam-status: Not processed
  • Authentication-results: mail20.mymailcheap.com; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=nderjung.net header.i=@nderjung.net header.b="zP/TIIwJ"; dkim-atps=neutral
  • Cc: minios-devel@xxxxxxxxxxxxx
  • Delivery-date: Fri, 08 Jan 2021 10:30:59 +0000
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>

Reviewed-by: Alexander Jung <a.jung@xxxxxxxxxxx>

> On 8. Jan 2021, at 10:00, Sharan Santhanam <sharan.santhanam@xxxxxxxxx> wrote:
> 
> The 9pfs driver fails to get the configuration when the
> virtio_config_get returns a value greater than 0. The function
> description on virtio_config_get was incorrect. The patches
> changes the error check in the virtio-9p and the function
> description
> 
> Signed-off-by: Sharan Santhanam <sharan.santhanam@xxxxxxxxx>
> ---
> plat/drivers/include/virtio/virtio_bus.h | 2 +-
> plat/drivers/virtio/virtio_9p.c          | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/plat/drivers/include/virtio/virtio_bus.h 
> b/plat/drivers/include/virtio/virtio_bus.h
> index 56f0dafe..b3bb8331 100644
> --- a/plat/drivers/include/virtio/virtio_bus.h
> +++ b/plat/drivers/include/virtio/virtio_bus.h
> @@ -240,7 +240,7 @@ static inline void virtio_feature_set(struct virtio_dev 
> *vdev, __u32 feature)
>  * @param type_len
>  *    The data type of the configuration data.
>  * @return int
> - *   0, on successful reading the configuration space.
> + *   >= 0, on successful reading the configuration space.
>  *    < 0, on error.
>  */
> static inline int virtio_config_get(struct virtio_dev *vdev, __u16 offset,
> diff --git a/plat/drivers/virtio/virtio_9p.c b/plat/drivers/virtio/virtio_9p.c
> index 045ce42f..7bd99b8d 100644
> --- a/plat/drivers/virtio/virtio_9p.c
> +++ b/plat/drivers/virtio/virtio_9p.c
> @@ -347,7 +347,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)))
> +                       &tag_len, 1, sizeof(tag_len)) < 0)
>       {
>               rc = -EAGAIN;
>               goto out;
> -- 
> 2.20.1
> 



 


Rackspace

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