The drm_gem_shmem_test_get_pages_sgt() gets a scatter-gather table using
the drm_gem_shmem_get_sg_table() function and rightfully calls
sg_free_table() on it. However, it's also supposed to kfree() the
returned sg_table, but doesn't.
This leads to a memory leak, reported by kmemleak. Fix it by adding a
kunit action to kfree the sgt when the test ends.
Reported-by: Philipp Stanner <phasta@mailbox.org>
Closes: https://lore.kernel.org/dri-devel/a7655158a6367ac46194d57f4b7433ef0772a73e.camel@mailbox.org/
Fixes:
|
||
|---|---|---|
| .. | ||
| .kunitconfig | ||
| Makefile | ||
| drm_atomic_state_test.c | ||
| drm_buddy_test.c | ||
| drm_client_modeset_test.c | ||
| drm_cmdline_parser_test.c | ||
| drm_connector_test.c | ||
| drm_damage_helper_test.c | ||
| drm_dp_mst_helper_test.c | ||
| drm_exec_test.c | ||
| drm_format_helper_test.c | ||
| drm_format_test.c | ||
| drm_framebuffer_test.c | ||
| drm_gem_shmem_test.c | ||
| drm_hdmi_state_helper_test.c | ||
| drm_kunit_edid.h | ||
| drm_kunit_helpers.c | ||
| drm_managed_test.c | ||
| drm_mm_test.c | ||
| drm_modes_test.c | ||
| drm_plane_helper_test.c | ||
| drm_probe_helper_test.c | ||
| drm_rect_test.c | ||