summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfcambus <fcambus@openbsd.org>2018-02-16 14:42:29 +0000
committerfcambus <fcambus@openbsd.org>2018-02-16 14:42:29 +0000
commitfe66c2735d5bf29c1d322cce8f2a79170ba90477 (patch)
tree2fae5e4b6e17158cfb91f1be1285cbd68fb94bd3
parentReflowing the grid in-place involved way too much memmove() for a big (diff)
downloadwireguard-openbsd-fe66c2735d5bf29c1d322cce8f2a79170ba90477.tar.xz
wireguard-openbsd-fe66c2735d5bf29c1d322cce8f2a79170ba90477.zip
Add sizes for free() in the i386 version of the Enhanced SpeedStep driver.
It was already done on amd64, but not on i386. Tested on an Atom N270. OK mpi@
-rw-r--r--sys/arch/i386/i386/est.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/arch/i386/i386/est.c b/sys/arch/i386/i386/est.c
index 39dc5606591..e1fab1059c0 100644
--- a/sys/arch/i386/i386/est.c
+++ b/sys/arch/i386/i386/est.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: est.c,v 1.48 2016/03/07 05:32:46 naddy Exp $ */
+/* $OpenBSD: est.c,v 1.49 2018/02/16 14:42:29 fcambus Exp $ */
/*
* Copyright (c) 2003 Michael Eriksson.
* All rights reserved.
@@ -1036,7 +1036,7 @@ est_acpi_pss_changed(struct acpicpu_pss *pss, int npss)
needtran = 0;
}
- free(est_fqlist->table, M_DEVBUF, 0);
+ free(est_fqlist->table, M_DEVBUF, npss * sizeof(struct est_op));
free(est_fqlist, M_DEVBUF, sizeof *est_fqlist);
est_fqlist = acpilist;
@@ -1141,7 +1141,7 @@ est_init(struct cpu_info *ci, int vendor)
if ((fake_table = mallocarray(3, sizeof(struct est_op),
M_DEVBUF, M_NOWAIT)) == NULL) {
- free(fake_fqlist, M_DEVBUF, 0);
+ free(fake_fqlist, M_DEVBUF, sizeof(struct fqlist));
printf("%s: EST: cannot allocate memory for fake "
"table\n", cpu_device);
return;
@@ -1206,7 +1206,7 @@ nospeedstep:
* it can't fail in that case and therefore can't reach here.
*/
free(est_fqlist->table, M_DEVBUF, 0);
- free(est_fqlist, M_DEVBUF, 0);
+ free(est_fqlist, M_DEVBUF, sizeof(*est_fqlist));
}
void