diff options
author | 2019-08-04 10:00:37 +0000 | |
---|---|---|
committer | 2019-08-04 10:00:37 +0000 | |
commit | afcc1f65afd12fcdee7716120bf0bdb000ed4388 (patch) | |
tree | 5558da2375010fb25efa612a2aaf978039bd9ec8 | |
parent | Implement smbios support on arm64. (diff) | |
download | wireguard-openbsd-afcc1f65afd12fcdee7716120bf0bdb000ed4388.tar.xz wireguard-openbsd-afcc1f65afd12fcdee7716120bf0bdb000ed4388.zip |
Unmap tables once we're done with them.
-rw-r--r-- | sys/arch/arm64/dev/smbios.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/sys/arch/arm64/dev/smbios.c b/sys/arch/arm64/dev/smbios.c index 7c2135a6764..911e056bb86 100644 --- a/sys/arch/arm64/dev/smbios.c +++ b/sys/arch/arm64/dev/smbios.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smbios.c,v 1.1 2019/08/04 09:27:09 kettenis Exp $ */ +/* $OpenBSD: smbios.c,v 1.2 2019/08/04 10:00:37 kettenis Exp $ */ /* * Copyright (c) 2006 Gordon Willem Klok <gklok@cogeco.ca> * Copyright (c) 2019 Mark Kettenis <kettenis@openbsd.org> @@ -95,13 +95,13 @@ smbios_attach(struct device *parent, struct device *self, void *aux) hdr = bus_space_vaddr(sc->sc_iot, ioh); if (strncmp(hdr->sig, "_SM3_", sizeof(hdr->sig)) != 0) - return; + goto fail; if (hdr->len != sizeof(*hdr) || hdr->epr != 0x01) - return; + goto fail; for (i = 0, p = (uint8_t *)hdr; i < hdr->len; i++) checksum += p[i]; if (checksum != 0) - return; + goto fail; printf(": SMBIOS %d.%d.%d", hdr->majrev, hdr->minrev, hdr->docrev); @@ -109,7 +109,7 @@ smbios_attach(struct device *parent, struct device *self, void *aux) smbios_entry.mjr = hdr->majrev; smbios_entry.min = hdr->minrev; smbios_entry.count = -1; - + addr = hdr->addr; size = hdr->size; @@ -148,7 +148,13 @@ smbios_attach(struct device *parent, struct device *self, void *aux) smbios_info(sc->sc_dev.dv_xname); } + bus_space_unmap(sc->sc_iot, ioh, size); + printf("\n"); + return; + +fail: + bus_space_unmap(sc->sc_iot, ioh, sizeof(*hdr)); } /* |