]> xenbits.xensource.com Git - seabios.git/commitdiff
init_virtio_blk, init_virtio_scsi: reset HBA on error
authorEric Northup <digitaleric@google.com>
Wed, 12 Mar 2014 20:42:35 +0000 (13:42 -0700)
committerKevin O'Connor <kevin@koconnor.net>
Thu, 20 Mar 2014 16:35:47 +0000 (12:35 -0400)
Extend commit 5f2d17d35b2339526f3b3d580b279ea78e406a25: reset on all error
paths, and also for virtio_blk not just virtio_scsi.

Signed-off-by: Eric Northup <digitaleric@google.com>
src/hw/virtio-blk.c
src/hw/virtio-scsi.c

index 7b22bf5beec2e2c48c9a58c5de214a1871d459c0..e2dbd3c94535318fc20205086285ad074c1c5c06 100644 (file)
@@ -153,6 +153,7 @@ init_virtio_blk(struct pci_device *pci)
     return;
 
 fail:
+    vp_reset(ioaddr);
     free(vdrive->vq);
     free(vdrive);
 }
index 48fb3e112afabc196455709cbc8457153169d143..8f966875bb79507d620df8676b4b0f2c42f1ab7f 100644 (file)
@@ -158,14 +158,13 @@ init_virtio_scsi(struct pci_device *pci)
     for (tot = 0, i = 0; i < 256; i++)
         tot += virtio_scsi_scan_target(pci, ioaddr, vq, i);
 
-    if (!tot) {
-        vp_reset(ioaddr);
+    if (!tot)
         goto fail;
-    }
 
     return;
 
 fail:
+    vp_reset(ioaddr);
     free(vq);
 }