Skip to content

Commit 0faa283

Browse files
Chen NiSasha Levin
authored andcommitted
drm/msm/a6xx: Check kzalloc return in a8xx_hfi_send_perf_table
[ Upstream commit b5c7a7f ] Check the return value of kzalloc() to prevent a NULL pointer dereference on allocation failure. Fixes: 06cfbca ("drm/msm/a6xx: Share dependency vote table with GMU") Signed-off-by: Chen Ni <nichen@iscas.ac.cn> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Reviewed-by: Akhil P Oommen <akhilpo@oss.qualcomm.com> Patchwork: https://patchwork.freedesktop.org/patch/721342/ Message-ID: <20260428073558.1234238-1-nichen@iscas.ac.cn> Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent cce2395 commit 0faa283

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,8 @@ static int a8xx_hfi_send_perf_table(struct a6xx_gmu *gmu)
289289
(gmu->nr_gpu_freqs * num_gx_votes * sizeof(gmu->gx_arc_votes[0])) +
290290
(gmu->nr_gmu_freqs * num_cx_votes * sizeof(gmu->cx_arc_votes[0]));
291291
tbl = kzalloc(size, GFP_KERNEL);
292+
if (!tbl)
293+
return -ENOMEM;
292294
tbl->type = HFI_TABLE_GPU_PERF;
293295

294296
/* First fill GX votes */

0 commit comments

Comments
 (0)