linux/drivers/gpu/drm/ttm
Thomas Hellström 47647795a6 drm/ttm: Fix an invalid freeing on already freed page in error path
commit 40510a941d upstream.

If caching mode change fails due to, for example, OOM we
free the allocated pages in a two-step process. First the pages
for which the caching change has already succeeded. Secondly
the pages for which a caching change did not succeed.

However the second step was incorrectly freeing the pages already
freed in the first step.

Fix.

Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Fixes: 379989e7cb ("drm/ttm/pool: Fix ttm_pool_alloc error path")
Cc: Christian König <christian.koenig@amd.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Christian Koenig <christian.koenig@amd.com>
Cc: Huang Rui <ray.huang@amd.com>
Cc: dri-devel@lists.freedesktop.org
Cc: <stable@vger.kernel.org> # v6.4+
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240221073324.3303-1-thomas.hellstrom@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2024-03-01 13:26:31 +01:00
..
Makefile drm/ttm: add ttm_sys_manager v3 2021-05-03 12:50:41 +02:00
ttm_agp_backend.c drm/ttm: Add a parameter to add extra pages into ttm_tt 2022-04-02 08:22:48 +05:30
ttm_bo.c drm/ttm: check null pointer before accessing when swapping 2023-08-11 12:08:22 +02:00
ttm_bo_util.c drm pull for 6.1-rc1 2022-10-05 11:24:12 -07:00
ttm_bo_vm.c Yang Shi has improved the behaviour of khugepaged collapsing of readonly 2022-05-26 12:32:41 -07:00
ttm_device.c drm/ttm: Reorder sys manager cleanup step 2023-11-08 14:11:00 +01:00
ttm_execbuf_util.c drm/ttm: fix logic inversion in ttm_eu_reserve_buffers 2022-04-11 16:00:57 +02:00
ttm_module.c LoongArch: Add writecombine support for drm 2022-06-03 20:09:27 +08:00
ttm_module.h drm/ttm: add ttm_sys_manager v3 2021-05-03 12:50:41 +02:00
ttm_pool.c drm/ttm: Fix an invalid freeing on already freed page in error path 2024-03-01 13:26:31 +01:00
ttm_range_manager.c drm/ttm: Implement intersect/compatible functions 2022-08-22 15:33:50 +02:00
ttm_resource.c drm/ttm: fix bulk_move corruption when adding a entry 2023-07-27 08:50:49 +02:00
ttm_sys_manager.c drm/ttm: add back a reference to the bdev to the res manager 2022-01-26 15:29:24 +01:00
ttm_tt.c drm/ttm: use kvcalloc() instead of kvmalloc_array() in ttm_tt v2 2022-04-21 14:47:30 +02:00