From: jordan Date: Fri, 23 Jul 2010 20:21:58 +0000 (+0000) Subject: Don't initialize acpiec pointer in acpi_softc until registration succeeds X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=bda5449c02802dc240651342303376fdbbb4d504;p=openbsd Don't initialize acpiec pointer in acpi_softc until registration succeeds ok deraadt --- diff --git a/sys/dev/acpi/acpiec.c b/sys/dev/acpi/acpiec.c index e48f51029bb..abe76b6e466 100644 --- a/sys/dev/acpi/acpiec.c +++ b/sys/dev/acpi/acpiec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpiec.c,v 1.33 2010/07/23 20:19:21 jordan Exp $ */ +/* $OpenBSD: acpiec.c,v 1.34 2010/07/23 20:21:58 jordan Exp $ */ /* * Copyright (c) 2006 Can Erkin Acar * @@ -263,7 +263,6 @@ acpiec_attach(struct device *parent, struct device *self, void *aux) printf(": Only single EC is supported\n"); return; } - sc->sc_acpi->sc_ec = sc; if (acpiec_getcrs(sc, aa)) { printf(": Failed to read resource settings\n"); @@ -275,6 +274,7 @@ acpiec_attach(struct device *parent, struct device *self, void *aux) return; } + sc->sc_acpi->sc_ec = sc; acpiec_get_events(sc); dnprintf(10, "%s: GPE: %d\n", DEVNAME(sc), sc->sc_gpe);