diff options
author | Frederic Cambus <fcambus@cvs.openbsd.org> | 2018-02-16 14:42:30 +0000 |
---|---|---|
committer | Frederic Cambus <fcambus@cvs.openbsd.org> | 2018-02-16 14:42:30 +0000 |
commit | 01869b72d5574228b58423adcdd4a639c990ec13 (patch) | |
tree | e6278837279b664eecb4271708cdd9909695c76a /sys/arch/i386 | |
parent | 090a355e0c6f2cb1f13e24ec34ea86d12f8b5d6f (diff) |
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@
Diffstat (limited to 'sys/arch/i386')
-rw-r--r-- | sys/arch/i386/i386/est.c | 8 |
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 |