mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Xie Yongji <xieyongji@bytedance.com>, mst@redhat.com
Cc: virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] virtio_net: Fix error handling in virtnet_restore()
Date: Tue, 25 May 2021 14:10:32 +0800	[thread overview]
Message-ID: <782e9d35-99be-b77e-73f7-3291e03d6fe6@redhat.com> (raw)
In-Reply-To: <20210517084516.332-1-xieyongji@bytedance.com>


在 2021/5/17 下午4:45, Xie Yongji 写道:
> Do some cleanups in virtnet_restore() when virtnet_cpu_notif_add() failed.
>
> Signed-off-by: Xie Yongji <xieyongji@bytedance.com>


Acked-by: Jason Wang <jasowang@redhat.com>


> ---
>   drivers/net/virtio_net.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index 7be93ca01650..5ca7d6780add 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -3250,8 +3250,11 @@ static __maybe_unused int virtnet_restore(struct virtio_device *vdev)
>   	virtnet_set_queues(vi, vi->curr_queue_pairs);
>   
>   	err = virtnet_cpu_notif_add(vi);
> -	if (err)
> +	if (err) {
> +		virtnet_freeze_down(vdev);
> +		remove_vq_common(vi);
>   		return err;
> +	}
>   
>   	return 0;
>   }


      reply	other threads:[~2021-05-25  6:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-17  8:45 Xie Yongji
2021-05-25  6:10 ` Jason Wang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=782e9d35-99be-b77e-73f7-3291e03d6fe6@redhat.com \
    --to=jasowang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=xieyongji@bytedance.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®