From bac5600a0a7cfb47dd02ae14fbaf386ccab465e7 Mon Sep 17 00:00:00 2001 From: fcambus Date: Mon, 18 Dec 2017 12:53:33 +0000 Subject: [PATCH] Add sizes for free() in libsa for amd64 and i386. OK tom@, deraadt@ --- sys/arch/amd64/stand/libsa/diskprobe.c | 8 ++++---- sys/arch/amd64/stand/libsa/softraid_amd64.c | 4 ++-- sys/arch/i386/stand/libsa/diskprobe.c | 8 ++++---- sys/arch/i386/stand/libsa/softraid_i386.c | 4 ++-- 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(" ", i); #endif - free(dip, 0); + free(dip, sizeof(*dip)); break; } @@ -136,7 +136,7 @@ hardprobe(void) if (debug) printf(" ", 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(" "); /* 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 @@ -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(" ", i); #endif - free(dip, 0); + free(dip, sizeof(*dip)); break; } @@ -136,7 +136,7 @@ hardprobe(void) if (debug) printf(" ", 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(" "); /* 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 @@ -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 -- 2.20.1