non-acpi x86 machines. This was lost in refactoring when moving /dev/apm
code from acpi.c to acpi_apm.c.
Found by Anton Lindqvist after report from xavier.s at mailoo dot org
ok kettenis@
-/* $OpenBSD: acpi_apm.c,v 1.2 2023/07/08 14:44:43 tobhe Exp $ */
+/* $OpenBSD: acpi_apm.c,v 1.3 2023/08/06 14:30:08 tobhe Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
struct acpi_softc *sc = acpi_softc;
int s;
+ if (sc == NULL)
+ return (ENXIO);
+
s = splbio();
switch (APMDEV(dev)) {
case APMDEV_CTL:
struct acpi_softc *sc = acpi_softc;
int s;
+ if (sc == NULL)
+ return (ENXIO);
+
s = splbio();
switch (APMDEV(dev)) {
case APMDEV_CTL:
struct apm_power_info *pi = (struct apm_power_info *)data;
int s;
+ if (sc == NULL)
+ return (ENXIO);
+
s = splbio();
/* fake APM */
switch (cmd) {
struct acpi_softc *sc = acpi_softc;
int s;
+ if (sc == NULL)
+ return (ENXIO);
+
switch (kn->kn_filter) {
case EVFILT_READ:
kn->kn_fop = &acpiread_filtops;