Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Cleanup and sanity-checking of OOB accesses and pointer-to-local issues (Coverity...
[palacios.git] / palacios / src / devices / lnx_virtio_nic.c
index 7ead43d..ad0b9e9 100644 (file)
@@ -198,6 +198,11 @@ static int virtio_deinit_state(struct guest_info *core, struct virtio_net_state
     if (ns->timer) { 
        v3_remove_timer(core,ns->timer);
     }
+
+    v3_lock_deinit(&(ns->rx_lock));
+    v3_lock_deinit(&(ns->tx_lock));
+
+
     return 0;
 }
 
@@ -569,7 +574,7 @@ static int virtio_io_read(struct guest_info *core,
                             virtio->pci_dev, 0);
            break;
 
-       case VIRTIO_NET_CONFIG ... VIRTIO_NET_CONFIG + ETH_ALEN:
+       case VIRTIO_NET_CONFIG ... VIRTIO_NET_CONFIG + ETH_ALEN - 1:
            *(uint8_t *)dst = virtio->net_cfg.mac[port_idx-VIRTIO_NET_CONFIG];
            break;
 
@@ -753,9 +758,6 @@ static int virtio_free(struct virtio_dev_state * virtio) {
        V3_Free(backend);
     }
 
-    v3_lock_deinit(&(virtio->rx_lock));
-    v3_lock_deinit(&(virtio->tx_lock));
-
     V3_Free(virtio);
 
     return 0;