[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] vhost: check for vhost_ops before using.
From: |
Marc-André Lureau |
Subject: |
Re: [Qemu-devel] [PATCH] vhost: check for vhost_ops before using. |
Date: |
Wed, 03 Aug 2016 08:37:05 +0000 |
Hi
On Wed, Aug 3, 2016 at 9:25 AM Ilya Maximets <address@hidden> wrote:
> 'vhost_set_vring_enable()' tries to call function using pointer to
> 'vhost_ops' which can be already zeroized in 'vhost_dev_cleanup()'
> while vhost disconnection.
>
> Fix that by checking 'vhost_ops' before using. This fixes QEMU crash
> on calling 'ethtool -L eth0 combined 2' if vhost disconnected.
>
> Signed-off-by: Ilya Maximets <address@hidden>
> ---
> hw/net/vhost_net.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
> index dc61dc1..f2d49ad 100644
> --- a/hw/net/vhost_net.c
> +++ b/hw/net/vhost_net.c
> @@ -428,7 +428,7 @@ int vhost_set_vring_enable(NetClientState *nc, int
> enable)
>
> nc->vring_enable = enable;
>
> - if (vhost_ops->vhost_set_vring_enable) {
> + if (vhost_ops && vhost_ops->vhost_set_vring_enable) {
> return vhost_ops->vhost_set_vring_enable(&net->dev, enable);
> }
>
would be nice for 2.7,
Reviewed-by: Marc-André Lureau <address@hidden>
>
> --
> 2.7.4
>
>
> --
Marc-André Lureau