diff options
| author | Nate Lawson <njl@FreeBSD.org> | 2005-11-24 05:23:56 +0000 |
|---|---|---|
| committer | Nate Lawson <njl@FreeBSD.org> | 2005-11-24 05:23:56 +0000 |
| commit | 1f6e47a32495016f0dced8874537f56612c4c8fb (patch) | |
| tree | 44ac9e686eb1d97ab550e2bd15b6d1b2cba83b1a /sys/dev | |
| parent | ce4210d673a2afd61732fb58a9df4b037b157f1a (diff) | |
Notes
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/acpica/acpi_smbat.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/dev/acpica/acpi_smbat.c b/sys/dev/acpica/acpi_smbat.c index 37216e14c02b5..39bfb3ccc14f6 100644 --- a/sys/dev/acpica/acpi_smbat.c +++ b/sys/dev/acpica/acpi_smbat.c @@ -371,11 +371,11 @@ acpi_smbat_get_bst(device_t dev, struct acpi_bst *bst) sc->bst.volt = val; acpi_smbat_info_updated(&sc->bst_lastupdated); - error = 0; out: - memcpy(bst, &sc->bst, sizeof(sc->bst)); + if (error == 0) + memcpy(bst, &sc->bst, sizeof(sc->bst)); ACPI_SERIAL_END(smbat); return (error); } @@ -445,13 +445,14 @@ acpi_smbat_get_bif(device_t dev, struct acpi_bif *bif) sc->bif.oeminfo, sizeof(sc->bif.oeminfo))) goto out; - acpi_smbat_info_updated(&sc->bif_lastupdated); - /* XXX check if device was replugged during read? */ + + acpi_smbat_info_updated(&sc->bif_lastupdated); error = 0; out: - memcpy(bif, &sc->bif, sizeof(sc->bif)); + if (error == 0) + memcpy(bif, &sc->bif, sizeof(sc->bif)); ACPI_SERIAL_END(smbat); return (error); } |
