Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151788469
D13837.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D13837.diff
View Options
Index: head/sys/geom/uzip/g_uzip_zlib.c
===================================================================
--- head/sys/geom/uzip/g_uzip_zlib.c
+++ head/sys/geom/uzip/g_uzip_zlib.c
@@ -132,7 +132,7 @@
{
void *ptr;
- ptr = malloc(type * size, M_GEOM_UZIP, M_NOWAIT);
+ ptr = mallocarray(type, size, M_GEOM_UZIP, M_NOWAIT);
return (ptr);
}
Index: head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c
===================================================================
--- head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c
+++ head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c
@@ -1620,7 +1620,7 @@
uint16_t i;
uint32_t *data;
- data = malloc(len * sizeof(uint32_t), M_DEVBUF, M_NOWAIT | M_ZERO);
+ data = mallocarray(len, sizeof(uint32_t), M_DEVBUF, M_NOWAIT | M_ZERO);
if (!data) {
BWN_ERRPRINTF(mac->mac_sc, "allocation for samples loading failed\n");
return -ENOMEM;
@@ -1663,7 +1663,8 @@
len = bw << 1;
}
- samples = malloc(len * sizeof(struct bwn_c32), M_DEVBUF, M_NOWAIT | M_ZERO);
+ samples = mallocarray(len, sizeof(struct bwn_c32), M_DEVBUF,
+ M_NOWAIT | M_ZERO);
if (!samples) {
BWN_ERRPRINTF(mac->mac_sc, "allocation for samples generation failed\n");
return 0;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Apr 11, 4:40 PM (7 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31299048
Default Alt Text
D13837.diff (1 KB)
Attached To
Mode
D13837: Wider adoption of mallocarray(9).
Attached
Detach File
Event Timeline
Log In to Comment