Add sizes for free() in libsa for amd64 and i386.
authorfcambus <fcambus@openbsd.org>
Mon, 18 Dec 2017 12:53:33 +0000 (12:53 +0000)
committerfcambus <fcambus@openbsd.org>
Mon, 18 Dec 2017 12:53:33 +0000 (12:53 +0000)
OK tom@, deraadt@

sys/arch/amd64/stand/libsa/diskprobe.c
sys/arch/amd64/stand/libsa/softraid_amd64.c
sys/arch/i386/stand/libsa/diskprobe.c
sys/arch/i386/stand/libsa/softraid_i386.c

index 6f3d9ba..555141e 100644 (file)
@@ -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
index fee685c..e117cd5 100644 (file)
@@ -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
index 46b4d0e..0ec5fb1 100644 (file)
@@ -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
index 2518211..0332b8e 100644 (file)
@@ -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