Commit b5c7a7f4 authored by Chen Ni's avatar Chen Ni Committed by Rob Clark
Browse files

drm/msm/a6xx: Check kzalloc return in a8xx_hfi_send_perf_table



Check the return value of kzalloc() to prevent a NULL pointer
dereference on allocation failure.

Fixes: 06cfbca0 ("drm/msm/a6xx: Share dependency vote table with GMU")
Signed-off-by: default avatarChen Ni <nichen@iscas.ac.cn>
Reviewed-by: default avatarDmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: default avatarAkhil 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: default avatarRob Clark <robin.clark@oss.qualcomm.com>
parent 55e0f0d1
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -289,6 +289,8 @@ static int a8xx_hfi_send_perf_table(struct a6xx_gmu *gmu)
		(gmu->nr_gpu_freqs * num_gx_votes * sizeof(gmu->gx_arc_votes[0])) +
		(gmu->nr_gmu_freqs * num_cx_votes * sizeof(gmu->cx_arc_votes[0]));
	tbl = kzalloc(size, GFP_KERNEL);
	if (!tbl)
		return -ENOMEM;
	tbl->type = HFI_TABLE_GPU_PERF;

	/* First fill GX votes */