Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 148728
b: refs/heads/master
c: fbe0efb
h: refs/heads/master
v: v3
  • Loading branch information
Kristian Høgsberg authored and Dave Airlie committed Jun 12, 2009
1 parent 345a0e4 commit 2342551
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 61f11699e7a92d932b31ded3715ad4f70eb26ef2
refs/heads/master: fbe0efb869efde8d847ede3a925230ef88910086
12 changes: 4 additions & 8 deletions trunk/include/drm/drmP.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2342551

Please sign in to comment.