From 7c9958b04333a79a1fdb11583aca48a6df2edeb9 Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Fri, 11 May 2012 11:42:39 -0300 Subject: msi: Guard msi/msix_write_config with msi_present Terminate msi/msix_write_config early if support is not enabled. This allows to remove checks at the caller site if MSI is optional. Signed-off-by: Jan Kiszka Signed-off-by: Michael S. Tsirkin --- hw/msix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hw/msix.c') diff --git a/hw/msix.c b/hw/msix.c index 59c7a83..339e652 100644 --- a/hw/msix.c +++ b/hw/msix.c @@ -187,7 +187,7 @@ void msix_write_config(PCIDevice *dev, uint32_t addr, int vector; bool was_masked; - if (!range_covers_byte(addr, len, enable_pos)) { + if (!msix_present(dev) || !range_covers_byte(addr, len, enable_pos)) { return; } -- cgit v1.1