Skip to content

Commit

Permalink
drm/msm/a6xx: fix a potential overflow issue
Browse files Browse the repository at this point in the history
It's allocating an array of a6xx_gpu_state_obj structure rathor than
its pointers.

This patch fix it.

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@gmail.com>
Signed-off-by: Rob Clark <robdclark@chromium.org>
  • Loading branch information
Zhenzhong Duan authored and Rob Clark committed Sep 12, 2020
1 parent 0a48db5 commit 08d3ab4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ static void a6xx_get_indexed_registers(struct msm_gpu *gpu,
int i;

a6xx_state->indexed_regs = state_kcalloc(a6xx_state, count,
sizeof(a6xx_state->indexed_regs));
sizeof(*a6xx_state->indexed_regs));
if (!a6xx_state->indexed_regs)
return;

Expand Down

0 comments on commit 08d3ab4

Please sign in to comment.