From 3991dbf3fa9262cfe379ef3005e0e8ec7271e9eb Mon Sep 17 00:00:00 2001 From: Doug Ambrisko Date: Thu, 16 Aug 2018 15:59:02 +0000 Subject: [PATCH] Fix a module Makefile error on amd64 so the IPMI HW interfaces are built. When the module is being unloaded and no HW interfaces were created don't clean up. This was exposed by the amd64 module build issue. --- sys/dev/ipmi/ipmi.c | 2 ++ sys/modules/ipmi/Makefile | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/ipmi/ipmi.c b/sys/dev/ipmi/ipmi.c index 57176ebf1b5..09a7f7a27bc 100644 --- a/sys/dev/ipmi/ipmi.c +++ b/sys/dev/ipmi/ipmi.c @@ -1053,6 +1053,8 @@ ipmi_unload(void *arg) int count; int i; + if (ipmi_devclass == NULL) + return; if (devclass_get_devices(ipmi_devclass, &devs, &count) != 0) return; for (i = 0; i < count; i++) diff --git a/sys/modules/ipmi/Makefile b/sys/modules/ipmi/Makefile index 37113751491..5a730ef7483 100644 --- a/sys/modules/ipmi/Makefile +++ b/sys/modules/ipmi/Makefile @@ -7,7 +7,7 @@ KMOD= ipmi SRCS= ipmi.c SRCS+= bus_if.h device_if.h -.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "i386" +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" SRCS+= ipmi_kcs.c ipmi_smic.c ipmi_smbios.c ipmi_ssif.c SRCS+= ipmi_acpi.c ipmi_isa.c ipmi_pci.c ipmi_smbus.c SRCS+= opt_acpi.h