diff options
author | Jordan Hargrave <jordan@cvs.openbsd.org> | 2011-04-07 20:16:20 +0000 |
---|---|---|
committer | Jordan Hargrave <jordan@cvs.openbsd.org> | 2011-04-07 20:16:20 +0000 |
commit | ea2fb0a5b8690a6e91c42b66d198264242134cbf (patch) | |
tree | ed46a83b22601bffb92d45605433dd55d342d45b /sys/dev | |
parent | 751d6524b071cf54384b00c7a63ff504dc35a671 (diff) |
Fix uninitialized name and x variables in setfan
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/acpi/acpitz.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/dev/acpi/acpitz.c b/sys/dev/acpi/acpitz.c index a459270d30c..e6c62ebaf5c 100644 --- a/sys/dev/acpi/acpitz.c +++ b/sys/dev/acpi/acpitz.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpitz.c,v 1.41 2011/04/07 20:14:38 marco Exp $ */ +/* $OpenBSD: acpitz.c,v 1.42 2011/04/07 20:16:19 jordan Exp $ */ /* * Copyright (c) 2006 Can Erkin Acar <canacar@openbsd.org> * Copyright (c) 2005 Marco Peereboom <marco@openbsd.org> @@ -248,18 +248,22 @@ acpitz_setfan(struct acpitz_softc *sc, int i, char *method) dnprintf(20, "%s: acpitz_setfan(%d, %s)\n", DEVNAME(sc), i, method); + x = 0; + snprintf(name, sizeof(name), "_AL%d", i); TAILQ_FOREACH(dl, &sc->sc_alx[i], dev_link) { if (aml_evalname(sc->sc_acpi, dl->dev_node, "_PR0",0 , NULL, &res1)) { printf("%s: %s[%d] _PR0 failed\n", DEVNAME(sc), name, x); aml_freevalue(&res1); + x++; continue; } if (res1.type != AML_OBJTYPE_PACKAGE) { printf("%s: %s[%d] _PR0 not a package\n", DEVNAME(sc), name, x); aml_freevalue(&res1); + x++; continue; } for (y = 0; y < res1.length; y++) { @@ -299,6 +303,7 @@ acpitz_setfan(struct acpitz_softc *sc, int i, char *method) } } aml_freevalue(&res1); + x++; } rv = 0; return (rv); |