Commit 70b30239 authored by Dave Jones's avatar Dave Jones

[PATCH] Missing checks in sis drm

parent fe4d8100
...@@ -50,6 +50,7 @@ set_t *setInit(void) ...@@ -50,6 +50,7 @@ set_t *setInit(void)
set_t *set; set_t *set;
set = (set_t *)MALLOC(sizeof(set_t)); set = (set_t *)MALLOC(sizeof(set_t));
if (set) {
for(i = 0; i < SET_SIZE; i++){ for(i = 0; i < SET_SIZE; i++){
set->list[i].free_next = i+1; set->list[i].free_next = i+1;
set->list[i].alloc_next = -1; set->list[i].alloc_next = -1;
...@@ -58,7 +59,7 @@ set_t *setInit(void) ...@@ -58,7 +59,7 @@ set_t *setInit(void)
set->free = 0; set->free = 0;
set->alloc = -1; set->alloc = -1;
set->trace = -1; set->trace = -1;
}
return set; return set;
} }
...@@ -172,6 +173,7 @@ static void *calloc(size_t nmemb, size_t size) ...@@ -172,6 +173,7 @@ static void *calloc(size_t nmemb, size_t size)
{ {
void *addr; void *addr;
addr = kmalloc(nmemb*size, GFP_KERNEL); addr = kmalloc(nmemb*size, GFP_KERNEL);
if (addr)
memset(addr, 0, nmemb*size); memset(addr, 0, nmemb*size);
return addr; return addr;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment