Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/riastradh-drm2]: src/sys/external/bsd/drm2/include/drm Just use kcalloc ...



details:   https://anonhg.NetBSD.org/src/rev/bac7ea200d75
branches:  riastradh-drm2
changeset: 788610:bac7ea200d75
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Tue Jan 21 20:49:29 2014 +0000

description:
Just use kcalloc in drm_malloc_ab.

diffstat:

 sys/external/bsd/drm2/include/drm/drm_mem_util.h |  7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diffs (21 lines):

diff -r 4a55e418a2e5 -r bac7ea200d75 sys/external/bsd/drm2/include/drm/drm_mem_util.h
--- a/sys/external/bsd/drm2/include/drm/drm_mem_util.h  Tue Jan 21 20:49:20 2014 +0000
+++ b/sys/external/bsd/drm2/include/drm/drm_mem_util.h  Tue Jan 21 20:49:29 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: drm_mem_util.h,v 1.1.2.2 2013/09/08 15:47:17 riastradh Exp $   */
+/*     $NetBSD: drm_mem_util.h,v 1.1.2.3 2014/01/21 20:49:29 riastradh Exp $   */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -43,10 +43,7 @@
 static inline void *
 drm_malloc_ab(size_t n, size_t size)
 {
-       if (size > (SIZE_MAX / n))
-               return NULL;
-
-       return kmalloc((n * size), GFP_KERNEL);
+       return kcalloc(n, size, GFP_KERNEL);
 }
 
 static inline void



Home | Main Index | Thread Index | Old Index