Message ID | 20200914022949.129-1-zhenzhong.duan@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 08d3ab4b46339bc6f97e83b54a3fb4f8bf8f4cd9 |
Headers | show |
Series | [v2] drm/msm/a6xx: Fix a size determination in a6xx_get_indexed_registers() | expand |
On Mon, Sep 14, 2020 at 10:29:49AM +0800, Zhenzhong Duan wrote: > It's allocating an array of a6xx_gpu_state_obj structure rather than > its pointers. > > Fixes: d6852b4b2d01 ("drm/msm/a6xx: Track and manage a6xx state memory") > Signed-off-by: Zhenzhong Duan <zhenzhong.duan@gmail.com> Reviewed-by: Jordan Crouse <jcrouse@codeaurora.org> > --- > v2: Update commit message per Markus, thanks > > drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c > index b12f5b4..e9ede19 100644 > --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c > +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c > @@ -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; > > -- > 1.8.3.1 >
diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c index b12f5b4..e9ede19 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c @@ -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;
It's allocating an array of a6xx_gpu_state_obj structure rather than its pointers. Fixes: d6852b4b2d01 ("drm/msm/a6xx: Track and manage a6xx state memory") Signed-off-by: Zhenzhong Duan <zhenzhong.duan@gmail.com> --- v2: Update commit message per Markus, thanks drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)