summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederic Cambus <fcambus@cvs.openbsd.org>2018-05-30 14:53:57 +0000
committerFrederic Cambus <fcambus@cvs.openbsd.org>2018-05-30 14:53:57 +0000
commit4a0ea7dfa003ba0f65014fb9c462ef93675e84f7 (patch)
treed3f6e841108c0436115b4daa10efabc36c55cedc
parent334ace3179b2ce9d2e9a32887df5a3292e278561 (diff)
Add sizes for free() for octeon.
OK deraadt@, visa@
-rw-r--r--sys/arch/octeon/dev/amdcf.c4
-rw-r--r--sys/arch/octeon/dev/octcf.c10
2 files changed, 7 insertions, 7 deletions
diff --git a/sys/arch/octeon/dev/amdcf.c b/sys/arch/octeon/dev/amdcf.c
index 15d9801fbb9..9c60dc598f6 100644
--- a/sys/arch/octeon/dev/amdcf.c
+++ b/sys/arch/octeon/dev/amdcf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: amdcf.c,v 1.5 2017/12/30 23:08:29 guenther Exp $ */
+/* $OpenBSD: amdcf.c,v 1.6 2018/05/30 14:53:56 fcambus Exp $ */
/*
* Copyright (c) 2007, Juniper Networks, Inc.
@@ -495,7 +495,7 @@ amdcfioctl(dev_t dev, u_long xfer, caddr_t addr, int flag, struct proc *p)
lp = malloc(sizeof(*lp), M_TEMP, M_WAITOK);
amdcfgetdisklabel(dev, sc, lp, 0);
bcopy(lp, sc->sc_dk.dk_label, sizeof(*lp));
- free(lp, M_TEMP, 0);
+ free(lp, M_TEMP, sizeof(*lp));
goto exit;
case DIOCGPDINFO:
diff --git a/sys/arch/octeon/dev/octcf.c b/sys/arch/octeon/dev/octcf.c
index 8d7550404dc..276ab1ae124 100644
--- a/sys/arch/octeon/dev/octcf.c
+++ b/sys/arch/octeon/dev/octcf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: octcf.c,v 1.31 2017/12/30 23:08:29 guenther Exp $ */
+/* $OpenBSD: octcf.c,v 1.32 2018/05/30 14:53:56 fcambus Exp $ */
/* $NetBSD: wd.c,v 1.193 1999/02/28 17:15:27 explorer Exp $ */
/*
@@ -563,7 +563,7 @@ octcfioctl(dev_t dev, u_long xfer, caddr_t addr, int flag, struct proc *p)
lp = malloc(sizeof(*lp), M_TEMP, M_WAITOK);
octcfgetdisklabel(dev, wd, lp, 0);
bcopy(lp, wd->sc_dk.dk_label, sizeof(*lp));
- free(lp, M_TEMP, 0);
+ free(lp, M_TEMP, sizeof(*lp));
goto exit;
case DIOCGPDINFO:
@@ -788,7 +788,7 @@ octcf_get_params(struct octcf_softc *wd, struct ataparams *params)
if (error != 0) {
printf("%s: identify failed: %d\n", __func__, error);
- free(tb, M_DEVBUF, 0);
+ free(tb, M_DEVBUF, ATAPARAMS_SIZE);
return CMD_ERR;
} else {
/*
@@ -818,7 +818,7 @@ octcf_get_params(struct octcf_softc *wd, struct ataparams *params)
params->atap_model[1] == 'E') ||
(params->atap_model[0] == 'F' &&
params->atap_model[1] == 'X'))) {
- free(tb, M_DEVBUF, 0);
+ free(tb, M_DEVBUF, ATAPARAMS_SIZE);
return CMD_OK;
}
for (i = 0; i < sizeof(params->atap_model); i += 2) {
@@ -834,7 +834,7 @@ octcf_get_params(struct octcf_softc *wd, struct ataparams *params)
*p = swap16(*p);
}
- free(tb, M_DEVBUF, 0);
+ free(tb, M_DEVBUF, ATAPARAMS_SIZE);
return CMD_OK;
}
}