hw/ipmi: reject NULL 'bmc' property rather than crash

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
Marc-André Lureau
2026-05-03 11:53:12 +04:00
parent 9817094a1e
commit d36cf704a2

View File

@@ -97,8 +97,14 @@ static void isa_ipmi_bmc_check(const Object *obj, const char *name,
{
IPMIBmc *bmc = IPMI_BMC(val);
if (bmc->intf)
if (!bmc) {
error_setg(errp, "%s cannot be set to NULL", name);
return;
}
if (bmc->intf) {
error_setg(errp, "BMC object is already in use");
}
}
void ipmi_bmc_find_and_link(Object *obj, Object **bmc)