Add sizes for free() in libsa for amd64 and i386

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Add sizes for free() in libsa for amd64 and i386

Frederic Cambus
Hi tech@,

Add sizes for free() in libsa for amd64 and i386.

Comments? OK?

Index: sys/arch/amd64/stand/libsa/diskprobe.c
===================================================================
RCS file: /cvs/src/sys/arch/amd64/stand/libsa/diskprobe.c,v
retrieving revision 1.21
diff -u -p -r1.21 diskprobe.c
--- sys/arch/amd64/stand/libsa/diskprobe.c 6 Nov 2017 08:57:34 -0000 1.21
+++ sys/arch/amd64/stand/libsa/diskprobe.c 8 Dec 2017 14:35:27 -0000
@@ -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: sys/arch/amd64/stand/libsa/softraid_amd64.c
===================================================================
RCS file: /cvs/src/sys/arch/amd64/stand/libsa/softraid_amd64.c,v
retrieving revision 1.4
diff -u -p -r1.4 softraid_amd64.c
--- sys/arch/amd64/stand/libsa/softraid_amd64.c 5 Jan 2017 11:18:54 -0000 1.4
+++ sys/arch/amd64/stand/libsa/softraid_amd64.c 8 Dec 2017 14:35:27 -0000
@@ -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: sys/arch/i386/stand/libsa/diskprobe.c
===================================================================
RCS file: /cvs/src/sys/arch/i386/stand/libsa/diskprobe.c,v
retrieving revision 1.44
diff -u -p -r1.44 diskprobe.c
--- sys/arch/i386/stand/libsa/diskprobe.c 21 Jul 2017 01:21:42 -0000 1.44
+++ sys/arch/i386/stand/libsa/diskprobe.c 8 Dec 2017 14:35:27 -0000
@@ -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: sys/arch/i386/stand/libsa/softraid_i386.c
===================================================================
RCS file: /cvs/src/sys/arch/i386/stand/libsa/softraid_i386.c,v
retrieving revision 1.2
diff -u -p -r1.2 softraid_i386.c
--- sys/arch/i386/stand/libsa/softraid_i386.c 11 Sep 2016 17:52:47 -0000 1.2
+++ sys/arch/i386/stand/libsa/softraid_i386.c 8 Dec 2017 14:35:27 -0000
@@ -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