On Mon, 5 Dec 2011 19:19:22 -0600 Rob Clark rob.clark@linaro.org wrote:
- usergart = kzalloc(3 * sizeof(*usergart), GFP_KERNEL);
- /* reserve 4k aligned/wide regions for userspace mappings: */
- for (i = 0; i < ARRAY_SIZE(fmts); i++) {
uint16_t h = 1, w = PAGE_SIZE >> i;
tiler_align(fmts[i], &w, &h);
/* note: since each region is 1 4kb page wide, and minimum
* number of rows, the height ends up being the same as the
* # of pages in the region
*/
usergart[i].height = h;
usergart[i].height_shift = ilog2(h);
Seems to be missing anallocation failure check