mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 15:20:10 +01:00
i965,i915: Return early if miptree allocation fails
If allocation fails in intel_miptree_create_layout(), don't proceed to dereference the miptree. Return an early NULL. Fixes static analysis error reported by Klocwork. Note: This is a candidate for the 9.1 branch. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com> Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
This commit is contained in:
parent
670f829102
commit
6b676e6634
2 changed files with 4 additions and 0 deletions
|
|
@ -260,6 +260,8 @@ intel_miptree_create_layout(struct intel_context *intel,
|
|||
GLuint num_samples)
|
||||
{
|
||||
struct intel_mipmap_tree *mt = calloc(sizeof(*mt), 1);
|
||||
if (!mt)
|
||||
return NULL;
|
||||
|
||||
DBG("%s target %s format %s level %d..%d <-- %p\n", __FUNCTION__,
|
||||
_mesa_lookup_enum_by_nr(target),
|
||||
|
|
|
|||
|
|
@ -260,6 +260,8 @@ intel_miptree_create_layout(struct intel_context *intel,
|
|||
GLuint num_samples)
|
||||
{
|
||||
struct intel_mipmap_tree *mt = calloc(sizeof(*mt), 1);
|
||||
if (!mt)
|
||||
return NULL;
|
||||
|
||||
DBG("%s target %s format %s level %d..%d <-- %p\n", __FUNCTION__,
|
||||
_mesa_lookup_enum_by_nr(target),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue