intel: Check for region allocation failure.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2010-08-05 08:34:09 +01:00
parent 9c98e9e6b5
commit 85cfe32180
1 changed files with 6 additions and 0 deletions

View File

@ -155,6 +155,9 @@ intel_region_alloc_internal(struct intel_context *intel,
}
region = calloc(sizeof(*region), 1);
if (region == NULL)
return region;
region->cpp = cpp;
region->width = width;
region->height = height;
@ -189,6 +192,9 @@ intel_region_alloc(struct intel_context *intel,
region = intel_region_alloc_internal(intel, cpp, width, height,
aligned_pitch / cpp, buffer);
if (region == NULL)
return region;
region->tiling = tiling;
return region;