Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F106098495
D13835.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
863 B
Referenced Files
None
Subscribers
None
D13835.diff
View Options
Index: head/sys/dev/drm2/drm_mem_util.h
===================================================================
--- head/sys/dev/drm2/drm_mem_util.h
+++ head/sys/dev/drm2/drm_mem_util.h
@@ -36,19 +36,15 @@
static __inline__ void *drm_calloc_large(size_t nmemb, size_t size)
{
- if (size != 0 && nmemb > SIZE_MAX / size)
- return NULL;
- return malloc(nmemb * size, DRM_MEM_DRIVER, M_NOWAIT | M_ZERO);
+ return mallocarray(nmemb, size, DRM_MEM_DRIVER, M_NOWAIT | M_ZERO);
}
/* Modeled after cairo's malloc_ab, it's like calloc but without the zeroing. */
static __inline__ void *drm_malloc_ab(size_t nmemb, size_t size)
{
- if (size != 0 && nmemb > SIZE_MAX / size)
- return NULL;
- return malloc(nmemb * size, DRM_MEM_DRIVER, M_NOWAIT);
+ return mallocarray(nmemb, size, DRM_MEM_DRIVER, M_NOWAIT);
}
static __inline void drm_free_large(void *ptr)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 26, 9:16 AM (11 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15596667
Default Alt Text
D13835.diff (863 B)
Attached To
Mode
D13835: Make use of mallocarray(9) in drm drivers.
Attached
Detach File
Event Timeline
Log In to Comment