Maxime Ripard <mrip...@kernel.org> writes:

Hello Maxime,

> 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 <pha...@mailbox.org>
> Closes: 
> https://lore.kernel.org/dri-devel/a7655158a6367ac46194d57f4b7433ef0772a73e.ca...@mailbox.org/
> Fixes: 93032ae634d4 ("drm/test: add a test suite for GEM objects backed by 
> shmem")
> Signed-off-by: Maxime Ripard <mrip...@kernel.org>
> ---

Reviewed-by: Javier Martinez Canillas <javi...@redhat.com>

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat

Reply via email to