Merge with DRI CVS tree: remove stale old context switching code and
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 4 lines · Linux Kernel Mailing List
void *DRM(realloc)(void *oldpt,
size_toldsize,size_tsize, int area) {(quoted diff) +0
-0void *pt;
Review
Quoted 10 lines
(quoted diff) +2
-2- if (!(pt = DRM(alloc)(size, area))) return NULL; + if (!(pt = kmalloc(size, GFP_KERNEL))) return NULL; if (oldpt && oldsize) { memcpy(pt, oldpt, oldsize); - DRM(free)(oldpt, oldsize, area); + kfree(oldpt); } return pt; }
this looks like buggy code, if you use realloc to shrink the allocation the memcpy overwrites random memory.