hv: assign: remove added ptirq entries if fails to add all

When adding ptirq entries, either successes with all number of entries added or
fails with none entries addes.
So remove added ptirq entries if error occurs during the process.

Tracked-On: #861
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Binbin Wu 2018-12-19 11:25:45 +08:00 committed by wenlingz
parent d48dc38780
commit d5865632ec
1 changed files with 4 additions and 0 deletions

View File

@ -755,6 +755,10 @@ int32_t ptirq_add_msix_remapping(struct acrn_vm *vm, uint16_t virt_bdf,
vector_added++;
}
if (vector_added != vector_count) {
ptirq_remove_msix_remapping(vm, virt_bdf, vector_added);
}
return (vector_added == vector_count) ? 0 : -ENODEV;
}