summary refs log tree commit diff stats
path: root/hw/pci/pci-hmp-cmds.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/pci/pci-hmp-cmds.c')
-rw-r--r--hw/pci/pci-hmp-cmds.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/hw/pci/pci-hmp-cmds.c b/hw/pci/pci-hmp-cmds.c
index a292d06ea0..fb7591d6ab 100644
--- a/hw/pci/pci-hmp-cmds.c
+++ b/hw/pci/pci-hmp-cmds.c
@@ -189,6 +189,11 @@ void hmp_pcie_aer_inject_error(Monitor *mon, const QDict *qdict)
         }
         error_status = num;
         correctable = qdict_get_try_bool(qdict, "correctable", false);
+    } else {
+        if (qdict_haskey(qdict, "correctable")) {
+            error_setg(&err, "-c is only valid with numeric error status");
+            goto out;
+        }
     }
     aer_err.status = error_status;
     aer_err.source_id = pci_requester_id(dev);