From 1af43bae065c0decb4df0cf59ea2d1a686eebabb Mon Sep 17 00:00:00 2001 From: xtraeme Date: Mon, 26 Mar 2007 04:22:28 +0000 Subject: [PATCH] aiboost_getcomp: fix memcpy and use the length provided by the ACPI Object. aiboost_refresh_sensors: fix a debugging printf. --- sys/dev/acpi/aiboost.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/sys/dev/acpi/aiboost.c b/sys/dev/acpi/aiboost.c index 2cbb72ff9bbc..bfc9a6b10daf 100644 --- a/sys/dev/acpi/aiboost.c +++ b/sys/dev/acpi/aiboost.c @@ -1,4 +1,4 @@ -/* $NetBSD: aiboost.c,v 1.2 2007/03/18 22:36:11 xtraeme Exp $ */ +/* $NetBSD: aiboost.c,v 1.3 2007/03/26 04:22:28 xtraeme Exp $ */ /*- * Copyright (c) 2007 Juan Romero Pardines @@ -28,7 +28,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: aiboost.c,v 1.2 2007/03/18 22:36:11 xtraeme Exp $"); +__KERNEL_RCSID(0, "$NetBSD: aiboost.c,v 1.3 2007/03/26 04:22:28 xtraeme Exp $"); #include #include @@ -214,7 +214,7 @@ aiboost_setup_sensors(struct aiboost_softc *sc) sc->sc_info[j].units = ENVSYS_SFANRPM; COPYDESCR(sc->sc_info[j].desc, sc->sc_aifan->elem[i].desc); DPRINTF(("%s: info[%d].desc=%s elem[%d].desc=%s\n", __func__, - j, sc->sc_info[j].desc, i, sc->sc_aivolt->elem[i].desc)); + j, sc->sc_info[j].desc, i, sc->sc_aifan->elem[i].desc)); } } @@ -384,11 +384,10 @@ aiboost_getcomp(ACPI_HANDLE *h, const char *name, struct aiboost_comp **comp) goto error; } - DPRINTF(("%s: id=%d str=%s\n", - __func__, c->elem[i - 1].id, str)); + DPRINTF(("%s: id=%d str=%s\n", __func__, c->elem[i - 1].id, + str)); - (void)memcpy(&c->elem[i - 1].desc, str, - sizeof(c->elem[i - 1].desc)); + (void)memcpy(c->elem[i - 1].desc, str, length); if (buf2.Pointer) AcpiOsFree(buf2.Pointer);