]> git.proxmox.com Git - qemu.git/blobdiff - hw/vhost_net.c
vhost: fix infinite loop on error path
[qemu.git] / hw / vhost_net.c
index 4a7b8194f2cdb67d43c22aeb2d900d56d01c6a45..c068be1f54944c26c61d0283a7553da7aae224da 100644 (file)
@@ -151,7 +151,7 @@ int vhost_net_start(struct vhost_net *net,
     return 0;
 fail:
     file.fd = -1;
-    while (--file.index >= 0) {
+    while (file.index-- > 0) {
         int r = ioctl(net->dev.control, VHOST_NET_SET_BACKEND, &file);
         assert(r >= 0);
     }