All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] virtio_net: Fix error handling in virtnet_restore()
@ 2021-05-17  8:45 Xie Yongji
  2021-05-25  6:10   ` Jason Wang
  0 siblings, 1 reply; 3+ messages in thread
From: Xie Yongji @ 2021-05-17  8:45 UTC (permalink / raw)
  To: mst, jasowang; +Cc: virtualization, linux-kernel

Do some cleanups in virtnet_restore() when virtnet_cpu_notif_add() failed.

Signed-off-by: Xie Yongji <xieyongji@bytedance.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;
 }
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-05-25  6:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-17  8:45 [PATCH] virtio_net: Fix error handling in virtnet_restore() Xie Yongji
2021-05-25  6:10 ` Jason Wang
2021-05-25  6:10   ` Jason Wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.