Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F145562681
D54113.1778201545.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
D54113.1778201545.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(1, sizeof(*dev));
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(1, sizeof(*dev));
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(1, sizeof(struct ofw_devdesc));
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(1, sizeof(struct devdesc));
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(1, sizeof(*dev));
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(1, sizeof(struct uboot_devdesc));
err = 0;
np = (devspec + strlen(dv->dv_name));
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, May 8, 12:52 AM (44 m, 47 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28597340
Default Alt Text
D54113.1778201545.diff (1 KB)
Attached To
Mode
D54113: stand: Use calloc instead of malloc for initialization of filesystem devsw
Attached
Detach File
Event Timeline
Log In to Comment