qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 5/9] virtio-net: handle virtio_net_handle_ctr


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH v2 5/9] virtio-net: handle virtio_net_handle_ctrl() error
Date: Fri, 23 Sep 2016 14:07:17 +0100
User-agent: Mutt/1.7.0 (2016-08-17)

On Wed, Sep 21, 2016 at 06:57:29PM +0200, Greg Kurz wrote:
> This error is caused by a buggy guest: let's switch the device to the
> broken state instead of terminating QEMU.
> 
> Signed-off-by: Greg Kurz <address@hidden>
> ---
> v2: - s/return/break in virtio_net_handle_ctrl() for consistency's sake
> ---
>  hw/net/virtio-net.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
> index 01f1351554aa..8a6f1d952467 100644
> --- a/hw/net/virtio-net.c
> +++ b/hw/net/virtio-net.c
> @@ -892,8 +892,8 @@ static void virtio_net_handle_ctrl(VirtIODevice *vdev, 
> VirtQueue *vq)
>          }
>          if (iov_size(elem->in_sg, elem->in_num) < sizeof(status) ||
>              iov_size(elem->out_sg, elem->out_num) < sizeof(ctrl)) {
> -            error_report("virtio-net ctrl missing headers");
> -            exit(1);
> +            virtio_error(vdev, "virtio-net ctrl missing headers");
> +            break;

We must detach and free elem to avoid leaks.

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]