diff options
author | Rob Clark <robdclark@chromium.org> | 2022-10-13 15:55:15 -0700 |
---|---|---|
committer | Rob Clark <robdclark@chromium.org> | 2022-10-14 09:33:12 -0700 |
commit | ec4fbd791519423726ce9fd5130de9a95365c8eb (patch) | |
tree | 238124a21f40f721eb351227875364b59e6c9c8c /drivers/gpu/drm/msm | |
parent | fab384c496a313a1083554fb1eb2332a6756be2e (diff) | |
download | linux-stable-ec4fbd791519423726ce9fd5130de9a95365c8eb.tar.gz linux-stable-ec4fbd791519423726ce9fd5130de9a95365c8eb.tar.bz2 linux-stable-ec4fbd791519423726ce9fd5130de9a95365c8eb.zip |
drm/msm/a6xx: Remove state objects from list before freeing
Technically it worked as it was before, only because it was using the
_safe version of the iterator. But it is sloppy practice to leave
dangling pointers.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Akhil P Oommen <quic_akhilpo@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/507017/
Link: https://lore.kernel.org/r/20221013225520.371226-4-robdclark@gmail.com
Diffstat (limited to 'drivers/gpu/drm/msm')
-rw-r--r-- | drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c index b0124d0f286c..a5c3d1ed255a 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c @@ -1046,8 +1046,10 @@ static void a6xx_gpu_state_destroy(struct kref *kref) if (a6xx_state->gmu_debug) kvfree(a6xx_state->gmu_debug->data); - list_for_each_entry_safe(obj, tmp, &a6xx_state->objs, node) + list_for_each_entry_safe(obj, tmp, &a6xx_state->objs, node) { + list_del(&obj->node); kvfree(obj); + } adreno_gpu_state_destroy(state); kfree(a6xx_state); |