From 23425516f492818b5171205caaa1ec99aacf25fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Tue, 9 Jun 2009 01:50:41 +1000 Subject: [PATCH] --- yaml --- r: 148728 b: refs/heads/master c: fbe0efb869efde8d847ede3a925230ef88910086 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/drm/drmP.h | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/[refs] b/[refs] index a40cc91ac61c..6f38c87901bd 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 61f11699e7a92d932b31ded3715ad4f70eb26ef2 +refs/heads/master: fbe0efb869efde8d847ede3a925230ef88910086 diff --git a/trunk/include/drm/drmP.h b/trunk/include/drm/drmP.h index afc21685230e..1cc51a0812fe 100644 --- a/trunk/include/drm/drmP.h +++ b/trunk/include/drm/drmP.h @@ -1573,18 +1573,14 @@ static __inline__ void *drm_calloc(size_t nmemb, size_t size, int area) static __inline__ void *drm_calloc_large(size_t nmemb, size_t size) { - u8 *addr; - - if (size <= PAGE_SIZE) + if (size * nmemb <= PAGE_SIZE) return kcalloc(nmemb, size, GFP_KERNEL); - addr = vmalloc(nmemb * size); - if (!addr) + if (size != 0 && nmemb > ULONG_MAX / size) return NULL; - memset(addr, 0, nmemb * size); - - return addr; + return __vmalloc(size * nmemb, + GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO, PAGE_KERNEL); } static __inline void drm_free_large(void *ptr)