Skip to content

Commit

Permalink
lima: fix memory leak related to u_transfer_helper_create()
Browse files Browse the repository at this point in the history
Direct leak of 16 byte(s) in 1 object(s) allocated from:
    #0 0x7fb6224340 in calloc (/usr/lib64/libasan.so.6.0.0+0xa4340)
    android-rpi#1 0x7facfdd5a0 in u_transfer_helper_create ../src/gallium/auxiliary/util/u_transfer_helper.c:580
    android-rpi#2 0x7facf2e09c in lima_resource_screen_init ../src/gallium/drivers/lima/lima_resource.c:935
    android-rpi#3 0x7facf23af4 in lima_screen_create ../src/gallium/drivers/lima/lima_screen.c:746
    #4 0x7fac83ed30 in kmsro_drm_screen_create ../src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c:124

Signed-off-by: Patrick Lerda <[email protected]>
Reviewed-by: Erico Nunes <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20764>
  • Loading branch information
Patrick Lerda authored and Marge Bot committed Jan 18, 2023
1 parent 926ba33 commit 5e3ca1f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/gallium/drivers/lima/lima_resource.c
Original file line number Diff line number Diff line change
Expand Up @@ -934,6 +934,12 @@ lima_resource_screen_init(struct lima_screen *screen)
U_TRANSFER_HELPER_MSAA_MAP);
}

void
lima_resource_screen_destroy(struct lima_screen *screen)
{
u_transfer_helper_destroy(screen->base.transfer_helper);
}

void
lima_resource_context_init(struct lima_context *ctx)
{
Expand Down
3 changes: 3 additions & 0 deletions src/gallium/drivers/lima/lima_resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ lima_transfer(struct pipe_transfer *trans)
void
lima_resource_screen_init(struct lima_screen *screen);

void
lima_resource_screen_destroy(struct lima_screen *screen);

void
lima_resource_context_init(struct lima_context *ctx);

Expand Down
1 change: 1 addition & 0 deletions src/gallium/drivers/lima/lima_screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ lima_screen_destroy(struct pipe_screen *pscreen)
lima_bo_cache_fini(screen);
lima_bo_table_fini(screen);
disk_cache_destroy(screen->disk_cache);
lima_resource_screen_destroy(screen);
ralloc_free(screen);
}

Expand Down

0 comments on commit 5e3ca1f

Please sign in to comment.