virtio: fix the bar starting index 34/28634/1
authorMohsin Kazmi <sykazmi@cisco.com>
Tue, 1 Sep 2020 16:18:48 +0000 (18:18 +0200)
committerMohsin Kazmi <sykazmi@cisco.com>
Tue, 1 Sep 2020 16:18:48 +0000 (18:18 +0200)
Type: fix

Change-Id: Ia28161b583ea26ab820a494332a79b64add7004d
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
src/vnet/devices/virtio/pci.c

index 307e73b..6c6edbc 100644 (file)
@@ -729,7 +729,7 @@ virtio_pci_read_caps (vlib_main_t * vm, virtio_if_t * vif, void **bar)
                        "[%4x] cfg type: %u, bar: %u, offset: %04x, len: %u",
                        pos, cap.cfg_type, cap.bar, cap.offset, cap.length);
 
-      if (cap.bar >= 1 && cap.bar <= 5)
+      if (cap.bar >= 0 && cap.bar <= 5)
        {
          vif->bar = bar[cap.bar];
          vif->bar_id = cap.bar;