Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144654663
D49705.1776040200.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D49705.1776040200.diff
View Options
diff --git a/stand/common/disk.c b/stand/common/disk.c
--- a/stand/common/disk.c
+++ b/stand/common/disk.c
@@ -468,7 +468,7 @@
if (*cp != '\0' && *cp != ':')
return (EINVAL);
- dev = malloc(sizeof(*dev));
+ dev = calloc(sizeof(*dev), 1);
if (dev == NULL)
return (ENOMEM);
dev->dd.d_unit = unit;
diff --git a/stand/kboot/kboot/hostdisk.c b/stand/kboot/kboot/hostdisk.c
--- a/stand/kboot/kboot/hostdisk.c
+++ b/stand/kboot/kboot/hostdisk.c
@@ -465,7 +465,7 @@
return (EINVAL);
}
free(fn);
- dev = malloc(sizeof(*dev));
+ dev = calloc(sizeof(*dev), 1);
if (dev == NULL)
return (ENOMEM);
dev->d_unit = 0;
diff --git a/stand/libofw/devicename.c b/stand/libofw/devicename.c
--- a/stand/libofw/devicename.c
+++ b/stand/libofw/devicename.c
@@ -98,7 +98,7 @@
if (ofw_path_to_handle(devspec, ofwtype, &rem_path) == -1)
return (ENOENT);
- idev = malloc(sizeof(struct ofw_devdesc));
+ idev = calloc(sizeof(struct ofw_devdesc), 1);
if (idev == NULL) {
printf("ofw_parsedev: malloc failed\n");
return (ENOMEM);
diff --git a/stand/libsa/dev.c b/stand/libsa/dev.c
--- a/stand/libsa/dev.c
+++ b/stand/libsa/dev.c
@@ -72,7 +72,7 @@
int unit, err;
char *cp;
- idev = malloc(sizeof(struct devdesc));
+ idev = calloc(sizeof(struct devdesc), 1);
if (idev == NULL)
return (ENOMEM);
diff --git a/stand/libsa/zfs/zfs.c b/stand/libsa/zfs/zfs.c
--- a/stand/libsa/zfs/zfs.c
+++ b/stand/libsa/zfs/zfs.c
@@ -1643,7 +1643,7 @@
spa = spa_find_by_name(poolname);
if (!spa)
return (ENXIO);
- dev = malloc(sizeof(*dev));
+ dev = calloc(sizeof(*dev), 1);
if (dev == NULL)
return (ENOMEM);
dev->pool_guid = spa->spa_guid;
diff --git a/stand/uboot/devicename.c b/stand/uboot/devicename.c
--- a/stand/uboot/devicename.c
+++ b/stand/uboot/devicename.c
@@ -102,7 +102,7 @@
}
if (dv == NULL)
return(ENOENT);
- idev = malloc(sizeof(struct uboot_devdesc));
+ idev = calloc(sizeof(struct uboot_devdesc), 1);
err = 0;
np = (devspec + strlen(dv->dv_name));
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Apr 13, 12:30 AM (7 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28334221
Default Alt Text
D49705.1776040200.diff (1 KB)
Attached To
Mode
D49705: stand: Use calloc instead of malloc for initialization of filesystem devsw
Attached
Detach File
Event Timeline
Log In to Comment