From d5e4e925ec1d248e212ef3dab602f74a65c288fb Mon Sep 17 00:00:00 2001 From: jsg Date: Thu, 4 Jun 2015 06:07:23 +0000 Subject: [PATCH] use mallocarray instead of malloc in drm_calloc --- sys/dev/pci/drm/drm_memory.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/pci/drm/drm_memory.c b/sys/dev/pci/drm/drm_memory.c index 5ad6c599cb6..dedbc94e5e1 100644 --- a/sys/dev/pci/drm/drm_memory.c +++ b/sys/dev/pci/drm/drm_memory.c @@ -1,4 +1,4 @@ -/* $OpenBSD: drm_memory.c,v 1.26 2014/07/12 18:48:52 tedu Exp $ */ +/* $OpenBSD: drm_memory.c,v 1.27 2015/06/04 06:07:23 jsg Exp $ */ /*- *Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. @@ -55,7 +55,7 @@ drm_calloc(size_t nmemb, size_t size) if (nmemb == 0 || SIZE_MAX / nmemb < size) return (NULL); else - return malloc(size * nmemb, M_DRM, M_NOWAIT | M_ZERO); + return mallocarray(size, nmemb, M_DRM, M_NOWAIT | M_ZERO); } void * -- 2.20.1