diff mbox series

[3/9] vhost-vdpa: remove the unnecessary assert(s->vhost_net)

Message ID 20200831082737.10983-4-jasowang@redhat.com (mailing list archive)
State New, archived
Headers show
Series refine vhost-vdpa initialization | expand

Commit Message

Jason Wang Aug. 31, 2020, 8:27 a.m. UTC
vhost_vdpa_add() can fail before s->vhost_net is set and
net_vhost_vdpa_init() can report error. So there's no need for this
assert. Let's remove it.

Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 net/vhost-vdpa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
index b7221beaa1..c4568b885e 100644
--- a/net/vhost-vdpa.c
+++ b/net/vhost-vdpa.c
@@ -190,7 +190,7 @@  static int net_vhost_vdpa_init(NetClientState *peer, const char *device,
     }
     s->vhost_vdpa.device_fd = vdpa_device_fd;
     ret = vhost_vdpa_add(nc, (void *)&s->vhost_vdpa);
-    assert(s->vhost_net);
+
     return ret;
 }