From fe71217ca86eb7ae8081bf3e26d30f2002d27691 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Tue, 21 Apr 2009 18:51:02 -0700 Subject: [PATCH] Unreference allocated bos in i965 render error paths Signed-off-by: Zdenek Kabelac Signed-off-by: Eric Anholt --- src/i965_render.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/i965_render.c b/src/i965_render.c index 704db975..e527f11c 100644 --- a/src/i965_render.c +++ b/src/i965_render.c @@ -1285,8 +1285,10 @@ i965_prepare_composite(int op, PicturePtr pSrcPicture, surface_state_bo = dri_bo_alloc(pI830->bufmgr, "surface_state", 3 * sizeof (brw_surface_state_padded), 4096); - if (dri_bo_map(surface_state_bo, 1) != 0) + if (dri_bo_map(surface_state_bo, 1) != 0) { + dri_bo_unreference(surface_state_bo); return FALSE; + } /* Set up the state buffer for the destination surface */ i965_set_picture_surface_state(surface_state_bo, 0, pDstPicture, pDst, TRUE); @@ -1305,6 +1307,7 @@ i965_prepare_composite(int op, PicturePtr pSrcPicture, binding_table_bo = dri_bo_alloc(pI830->bufmgr, "binding_table", 3 * sizeof(uint32_t), 4096); if (dri_bo_map (binding_table_bo, 1) != 0) { + dri_bo_unreference(binding_table_bo); dri_bo_unreference(surface_state_bo); return FALSE; }