From: Eric Northup Date: Wed, 12 Mar 2014 20:42:35 +0000 (-0700) Subject: init_virtio_blk, init_virtio_scsi: reset HBA on error X-Git-Tag: rel-1.7.5-rc1~32 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=5e03881f98b3331f2459e00101474c06a8f3a065;p=seabios.git init_virtio_blk, init_virtio_scsi: reset HBA on error Extend commit 5f2d17d35b2339526f3b3d580b279ea78e406a25: reset on all error paths, and also for virtio_blk not just virtio_scsi. Signed-off-by: Eric Northup --- diff --git a/src/hw/virtio-blk.c b/src/hw/virtio-blk.c index 7b22bf5..e2dbd3c 100644 --- a/src/hw/virtio-blk.c +++ b/src/hw/virtio-blk.c @@ -153,6 +153,7 @@ init_virtio_blk(struct pci_device *pci) return; fail: + vp_reset(ioaddr); free(vdrive->vq); free(vdrive); } diff --git a/src/hw/virtio-scsi.c b/src/hw/virtio-scsi.c index 48fb3e1..8f96687 100644 --- a/src/hw/virtio-scsi.c +++ b/src/hw/virtio-scsi.c @@ -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); }