summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorXie Yongji <xieyongji@bytedance.com>2021-05-17 11:45:16 +0300
committerMichael S. Tsirkin <mst@redhat.com>2021-07-03 11:50:52 +0300
commit3f2869cace829fb4b80fc53b3ddaa7f4ba9acbf1 (patch)
treefecec2c89df70fc7f9d4a3030e3495b608c1f474 /drivers/net
parentb71ba22e7c6c6b279c66f53ee7818709774efa1f (diff)
downloadlinux-3f2869cace829fb4b80fc53b3ddaa7f4ba9acbf1.tar.xz
virtio_net: Fix error handling in virtnet_restore()
Do some cleanups in virtnet_restore() when virtnet_cpu_notif_add() failed. Signed-off-by: Xie Yongji <xieyongji@bytedance.com> Link: https://lore.kernel.org/r/20210517084516.332-1-xieyongji@bytedance.com Acked-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/virtio_net.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index b0b81458ca94..4fff7cd24a88 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -3310,8 +3310,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;
}