diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index 8062e1743c1d6d2cf3b7643f81afffcd5c0fcfcc..45b947bcfe49f20b8e4cf63da93bdf951335b23e 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -946,7 +946,6 @@ static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGList *sglist, uint64_t sum = 0; int off_idx = -1; int64_t off_pos = -1; - int tbl_entry_size; IDEBus *bus = &ad->port; BusState *qbus = BUS(bus); @@ -974,6 +973,7 @@ static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGList *sglist, /* Get entries in the PRDT, init a qemu sglist accordingly */ if (prdtl > 0) { AHCI_SG *tbl = (AHCI_SG *)prdt; + int tbl_entry_size = 0; sum = 0; for (i = 0; i < prdtl; i++) { tbl_entry_size = prdt_tbl_entry_size(&tbl[i]);