diff --git a/src/gallium/drivers/asahi/agx_pipe.c b/src/gallium/drivers/asahi/agx_pipe.c index 1e33729df1d..45e99eb7f0b 100644 --- a/src/gallium/drivers/asahi/agx_pipe.c +++ b/src/gallium/drivers/asahi/agx_pipe.c @@ -174,8 +174,10 @@ agx_resource_from_handle(struct pipe_screen *pscreen, /* We need strides to be aligned. ail asserts this, but we want to fail * gracefully so the app can handle the error. */ - if (rsc->modifier == DRM_FORMAT_MOD_LINEAR && (whandle->stride % 16) != 0) + if (rsc->modifier == DRM_FORMAT_MOD_LINEAR && (whandle->stride % 16) != 0) { + FREE(rsc); return false; + } prsc = &rsc->base;