Commit d36cf704a2 for qemu.org

commit d36cf704a23c3c00db2209f731e636e768917909
Author: Marc-André Lureau <marcandre.lureau@redhat.com>
Date:   Sun May 3 11:53:12 2026 +0400

    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>

diff --git a/hw/ipmi/ipmi.c b/hw/ipmi/ipmi.c
index b49affacce..74818ff3ce 100644
--- a/hw/ipmi/ipmi.c
+++ b/hw/ipmi/ipmi.c
@@ -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)