gallum/asahi: fix memory leak in agx_resource_from_handle

Missing FREE(rsc)


Apply 1 suggestion(s) to 1 file(s)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20760>
This commit is contained in:
Joshua Peisach
2023-01-17 21:09:05 -05:00
committed by Marge Bot
parent b82d9b1a3d
commit 257bb11332

View File

@@ -177,10 +177,12 @@ agx_resource_from_handle(struct pipe_screen *pscreen,
agx_resource_setup(dev, rsc);
if (rsc->layout.tiling == AIL_TILING_LINEAR)
if (rsc->layout.tiling == AIL_TILING_LINEAR) {
rsc->layout.linear_stride_B = whandle->stride;
else if (whandle->stride != ail_get_wsi_stride_B(&rsc->layout, 0))
} else if (whandle->stride != ail_get_wsi_stride_B(&rsc->layout, 0)) {
FREE(rsc);
return NULL;
}
assert(whandle->offset == 0);