Page MenuHomeFreeBSD

D13837.diff
No OneTemporary

D13837.diff

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

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)

Event Timeline