Commit dd1f4078 authored by Jeff Dike's avatar Jeff Dike Committed by Michael S. Tsirkin

vhost-net: minor cleanup

Delete a label and goto from vhost_net_set_backend
Inverting a test allows a label and goto to be eliminated.
Signed-off-by: default avatarJeff Dike <jdike@linux.intel.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent 373a83a6
...@@ -519,13 +519,12 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd) ...@@ -519,13 +519,12 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd)
/* start polling new socket */ /* start polling new socket */
oldsock = vq->private_data; oldsock = vq->private_data;
if (sock == oldsock) if (sock != oldsock){
goto done; vhost_net_disable_vq(n, vq);
rcu_assign_pointer(vq->private_data, sock);
vhost_net_enable_vq(n, vq);
}
vhost_net_disable_vq(n, vq);
rcu_assign_pointer(vq->private_data, sock);
vhost_net_enable_vq(n, vq);
done:
if (oldsock) { if (oldsock) {
vhost_net_flush_vq(n, index); vhost_net_flush_vq(n, index);
fput(oldsock->file); fput(oldsock->file);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment