From 92946d81a6a1d7d9cf3ba0fe9c2a5e9f6af60472 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Sun, 6 Sep 2015 16:47:49 +0000 Subject: clarify malloc arguments (base + length...) --- sys/dev/acpi/acpi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/dev/acpi/acpi.c') diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c index f451f9ef782..4bb5d543aec 100644 --- a/sys/dev/acpi/acpi.c +++ b/sys/dev/acpi/acpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi.c,v 1.293 2015/08/28 00:03:53 deraadt Exp $ */ +/* $OpenBSD: acpi.c,v 1.294 2015/09/06 16:47:48 deraadt Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert * Copyright (c) 2005 Jordan Hargrave @@ -1187,7 +1187,7 @@ acpi_maptable(struct acpi_softc *sc, paddr_t addr, const char *sig, } /* Allocate copy */ - entry = malloc(len + sizeof(*entry), M_DEVBUF, M_NOWAIT); + entry = malloc(sizeof(*entry) + len, M_DEVBUF, M_NOWAIT); if (entry != NULL) { memcpy(entry->q_data, handle.va, len); entry->q_table = entry->q_data; -- cgit v1.2.3