Skip to content

Commit ec4fbd7

Browse files
committed
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 <[email protected]> Reviewed-by: Chia-I Wu <[email protected]> Reviewed-by: Akhil P Oommen <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/507017/ Link: https://lore.kernel.org/r/[email protected]
1 parent fab384c commit ec4fbd7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1046,8 +1046,10 @@ static void a6xx_gpu_state_destroy(struct kref *kref)
10461046
if (a6xx_state->gmu_debug)
10471047
kvfree(a6xx_state->gmu_debug->data);
10481048

1049-
list_for_each_entry_safe(obj, tmp, &a6xx_state->objs, node)
1049+
list_for_each_entry_safe(obj, tmp, &a6xx_state->objs, node) {
1050+
list_del(&obj->node);
10501051
kvfree(obj);
1052+
}
10511053

10521054
adreno_gpu_state_destroy(state);
10531055
kfree(a6xx_state);

0 commit comments

Comments
 (0)