summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorFrederic Cambus <fcambus@cvs.openbsd.org>2017-12-18 12:53:34 +0000
committerFrederic Cambus <fcambus@cvs.openbsd.org>2017-12-18 12:53:34 +0000
commit562ae98ff9402086bf3301767cf4b0b0047f47b2 (patch)
tree7cc1d445f46ab54eeb8cbc7ea65cce33033f523f /sys
parente394e1d22d3974abc855fd028ac9a792afe73997 (diff)
Add sizes for free() in libsa for amd64 and i386.
OK tom@, deraadt@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/amd64/stand/libsa/diskprobe.c8
-rw-r--r--sys/arch/amd64/stand/libsa/softraid_amd64.c4
-rw-r--r--sys/arch/i386/stand/libsa/diskprobe.c8
-rw-r--r--sys/arch/i386/stand/libsa/softraid_i386.c4
4 files changed, 12 insertions, 12 deletions
diff --git a/sys/arch/amd64/stand/libsa/diskprobe.c b/sys/arch/amd64/stand/libsa/diskprobe.c
index 6f3d9ba1045..555141e1147 100644
--- a/sys/arch/amd64/stand/libsa/diskprobe.c
+++ b/sys/arch/amd64/stand/libsa/diskprobe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: diskprobe.c,v 1.21 2017/11/06 08:57:34 yasuoka Exp $ */
+/* $OpenBSD: diskprobe.c,v 1.22 2017/12/18 12:53:33 fcambus Exp $ */
/*
* Copyright (c) 1997 Tobias Weingartner
@@ -94,7 +94,7 @@ floppyprobe(void)
if (debug)
printf(" <!fd%u>", i);
#endif
- free(dip, 0);
+ free(dip, sizeof(*dip));
break;
}
@@ -136,7 +136,7 @@ hardprobe(void)
if (debug)
printf(" <!hd%u>", i&0x7f);
#endif
- free(dip, 0);
+ free(dip, sizeof(*dip));
break;
}
@@ -323,7 +323,7 @@ cdprobe(void)
#if 0
if (bios_getdiskinfo(cddev, &dip->bios_info)) {
printf(" <!cd0>"); /* XXX */
- free(dip, 0);
+ free(dip, sizeof(*dip));
return;
}
#endif
diff --git a/sys/arch/amd64/stand/libsa/softraid_amd64.c b/sys/arch/amd64/stand/libsa/softraid_amd64.c
index fee685c7532..e117cd5a52f 100644
--- a/sys/arch/amd64/stand/libsa/softraid_amd64.c
+++ b/sys/arch/amd64/stand/libsa/softraid_amd64.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid_amd64.c,v 1.4 2017/01/05 11:18:54 stsp Exp $ */
+/* $OpenBSD: softraid_amd64.c,v 1.5 2017/12/18 12:53:33 fcambus Exp $ */
/*
* Copyright (c) 2012 Joel Sing <jsing@openbsd.org>
@@ -305,7 +305,7 @@ srprobe(void)
}
explicit_bzero(md, SR_META_SIZE * DEV_BSIZE);
- free(md, 0);
+ free(md, SR_META_SIZE * DEV_BSIZE);
}
int
diff --git a/sys/arch/i386/stand/libsa/diskprobe.c b/sys/arch/i386/stand/libsa/diskprobe.c
index 46b4d0e56bb..0ec5fb17b5d 100644
--- a/sys/arch/i386/stand/libsa/diskprobe.c
+++ b/sys/arch/i386/stand/libsa/diskprobe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: diskprobe.c,v 1.44 2017/07/21 01:21:42 yasuoka Exp $ */
+/* $OpenBSD: diskprobe.c,v 1.45 2017/12/18 12:53:33 fcambus Exp $ */
/*
* Copyright (c) 1997 Tobias Weingartner
@@ -94,7 +94,7 @@ floppyprobe(void)
if (debug)
printf(" <!fd%u>", i);
#endif
- free(dip, 0);
+ free(dip, sizeof(*dip));
break;
}
@@ -136,7 +136,7 @@ hardprobe(void)
if (debug)
printf(" <!hd%u>", i&0x7f);
#endif
- free(dip, 0);
+ free(dip, sizeof(*dip));
break;
}
@@ -310,7 +310,7 @@ cdprobe(void)
#if 0
if (bios_getdiskinfo(cddev, &dip->bios_info)) {
printf(" <!cd0>"); /* XXX */
- free(dip, 0);
+ free(dip, sizeof(*dip));
return;
}
#endif
diff --git a/sys/arch/i386/stand/libsa/softraid_i386.c b/sys/arch/i386/stand/libsa/softraid_i386.c
index 25182119eac..0332b8e778b 100644
--- a/sys/arch/i386/stand/libsa/softraid_i386.c
+++ b/sys/arch/i386/stand/libsa/softraid_i386.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid_i386.c,v 1.2 2016/09/11 17:52:47 jsing Exp $ */
+/* $OpenBSD: softraid_i386.c,v 1.3 2017/12/18 12:53:33 fcambus Exp $ */
/*
* Copyright (c) 2012 Joel Sing <jsing@openbsd.org>
@@ -300,7 +300,7 @@ srprobe(void)
}
explicit_bzero(md, SR_META_SIZE * DEV_BSIZE);
- free(md, 0);
+ free(md, SR_META_SIZE * DEV_BSIZE);
}
int