[Mesa-dev] [RFC 3/7] gallium/swrast: fix dri_sw_dt->data free func not matching alloc func

Jose Fonseca jfonseca at vmware.com
Thu Apr 28 15:57:17 UTC 2016


On 28/04/16 08:34, Chih-Wei Huang wrote:
> From: WuZhen <wuzhen at jidemail.com>
>
> The old code causes crashes when using software rendering.
>
> NO_REF_TASK
> tested: local run
>
> Change-Id: Ib1d7f388886b9f25ccc13afdd28d1e34f76162d3
> Signed-off-by: Chih-Wei Huang <cwhuang at linux.org.tw>
> ---
>   src/gallium/winsys/sw/dri/dri_sw_winsys.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/gallium/winsys/sw/dri/dri_sw_winsys.c b/src/gallium/winsys/sw/dri/dri_sw_winsys.c
> index 5c98f26..94d5092 100644
> --- a/src/gallium/winsys/sw/dri/dri_sw_winsys.c
> +++ b/src/gallium/winsys/sw/dri/dri_sw_winsys.c
> @@ -125,7 +125,7 @@ dri_sw_displaytarget_destroy(struct sw_winsys *ws,
>   {
>      struct dri_sw_displaytarget *dri_sw_dt = dri_sw_displaytarget(dt);
>
> -   FREE(dri_sw_dt->data);
> +   align_free(dri_sw_dt->data);
>
>      FREE(dri_sw_dt);
>   }
>

Reviewed-by: Jose Fonseca <jfonseca at vmware.com>

It doesn't affect Android, but 
src/gallium/winsys/sw/xlib/xlib_sw_winsys.c has the same FREE  / 
align_free mismatch:

diff --git a/src/gallium/winsys/sw/xlib/xlib_sw_winsys.c 
b/src/gallium/winsys/sw/xlib/xlib_sw_winsys.c
index cc2a3de..8753139 100644
--- a/src/gallium/winsys/sw/xlib/xlib_sw_winsys.c
+++ b/src/gallium/winsys/sw/xlib/xlib_sw_winsys.c
@@ -268,7 +268,7 @@ xlib_displaytarget_destroy(struct sw_winsys *ws,
              xlib_dt->tempImage->data = NULL;
        }
        else {
-         FREE(xlib_dt->data);
+         align_free(xlib_dt->data);
           if (xlib_dt->tempImage && xlib_dt->tempImage->data == 
xlib_dt->data) {
              xlib_dt->tempImage->data = NULL;
           }


I didn't spot others.

Changes to both files should be cross ported to stable branches.

Jose


More information about the mesa-dev mailing list