Skip to contentSkip to conversation

vhost-user: delete net client if necessary

PATCH Superseded linzhecheng 2 participants 2 messages Jun 11, 2018 – Jun 12, 2018 Networking

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vhost-user: delete net client if necessary

As qemu_new_net_client create new ncs but error happens later, ncs will be left in global net_clients list, so we need to cleanup them.

net/vhost-user.c +1 -0
index 608b837175..1c7ee48b60 100644
@@ -345,6 +345,7 @@ err:
             s->vhost_user = NULL;
         }
     }
+    qemu_del_net_client(nc0);
 
     return -1;
 }
Signature · 1 line
2.12.2.windows.2
#1 lore raw
Quoted 10 lines · linzhecheng

As qemu_new_net_client create new ncs but error happens later, ncs will be left in global net_clients list, so we need to cleanup them.

net/vhost-user.c +0 -0
index 608b837175..1c7ee48b60 100644

net/vhost-user.c err: · line 351

Quoted 7 lines
net/vhost-user.c +1 -0
@@ -345,6 +345,7 @@ err:
              s->vhost_user = NULL;
          }
      }
+    qemu_del_net_client(nc0);
 
      return -1;
  }

Can nc0 be NULL here?

And please try to use "Fixes:" tag to ease stable maintenance.

Thanks