sna: Free the handle after pwrite buffer allocation failure
Having just allocated the handle, we need to free it if we then fail to allocate memory for the buffer. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
4b3b25f0be
commit
be241fb25e
|
|
@ -5320,7 +5320,8 @@ struct kgem_bo *kgem_create_buffer(struct kgem *kgem,
|
|||
old = &bo->base;
|
||||
bo = buffer_alloc_with_data(num_pages(old));
|
||||
if (bo == NULL) {
|
||||
free(old);
|
||||
old->refcnt= 0;
|
||||
kgem_bo_free(kgem, old);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue