summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgwk <gwk@openbsd.org>2007-06-15 22:37:40 +0000
committergwk <gwk@openbsd.org>2007-06-15 22:37:40 +0000
commit8e662135335fa8e599c1ba1657df722c396cc3ad (patch)
tree08289955b4b1b58f326f2ca2eebf0dc31018802e
parentdon't use static data in recursive functions; from FreeBSD; fixes PR 5509 (diff)
downloadwireguard-openbsd-8e662135335fa8e599c1ba1657df722c396cc3ad.tar.xz
wireguard-openbsd-8e662135335fa8e599c1ba1657df722c396cc3ad.zip
Check that sc_notify actually points to something before attempting to call
it. Fixes marco@'s post c2k7 panics. ok marco
-rw-r--r--sys/dev/acpi/acpicpu.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/acpi/acpicpu.c b/sys/dev/acpi/acpicpu.c
index 8a171529a84..151f1acd775 100644
--- a/sys/dev/acpi/acpicpu.c
+++ b/sys/dev/acpi/acpicpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpicpu.c,v 1.25 2007/05/31 17:49:16 gwk Exp $ */
+/* $OpenBSD: acpicpu.c,v 1.26 2007/06/15 22:37:40 gwk Exp $ */
/*
* Copyright (c) 2005 Marco Peereboom <marco@openbsd.org>
*
@@ -510,7 +510,8 @@ acpicpu_notify(struct aml_node *node, int notify_type, void *arg)
case 0x80: /* _PPC changed, retrieve new values */
acpicpu_getpct(sc);
acpicpu_getpss(sc);
- sc->sc_notify(sc->sc_pss, sc->sc_pss_len);
+ if (sc->sc_notify)
+ sc->sc_notify(sc->sc_pss, sc->sc_pss_len);
break;
default:
printf("%s: unhandled cpu event %x\n", DEVNAME(sc),