From 2bb7e475eeae9ab019b66427855c2a46d9437d27 Mon Sep 17 00:00:00 2001 From: Gordon Willem Klok Date: Fri, 15 Jun 2007 22:37:41 +0000 Subject: Check that sc_notify actually points to something before attempting to call it. Fixes marco@'s post c2k7 panics. ok marco --- sys/dev/acpi/acpicpu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sys') 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 * @@ -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), -- cgit v1.2.3