Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 77702eb9 authored by Prasad Sodagudi's avatar Prasad Sodagudi Committed by Gerrit - the friendly Code Review server
Browse files

msm: kgsl: Allocate enough space for the fault detect registers



The adreno_ft_regs and adreno_ft_regs_val arrays are supposed
to store unsigned int values but only the count was was being
allocated leading to overruns. Allocated enough space for
the array values.

CRs-Fixed: 804683
Change-Id: Id195eebdc5d3f1d06bdb348e56915f1847a0f5d5
Signed-off-by: default avatarMohammed Khajapasha <mkhaja@codeaurora.org>
Signed-off-by: default avatarPrasad Sodagudi <psodagud@codeaurora.org>
parent e6d52a06
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1011,11 +1011,13 @@ static int adreno_init(struct kgsl_device *device)
	adreno_ft_regs_num = (ARRAY_SIZE(adreno_ft_regs_default) +
				   gpudev->ft_perf_counters_count*2);

	adreno_ft_regs = kzalloc(adreno_ft_regs_num, GFP_KERNEL);
	adreno_ft_regs = kzalloc(adreno_ft_regs_num * sizeof(unsigned int),
						GFP_KERNEL);
	if (!adreno_ft_regs)
		return -ENOMEM;

	adreno_ft_regs_val = kzalloc(adreno_ft_regs_num, GFP_KERNEL);
	adreno_ft_regs_val = kzalloc(adreno_ft_regs_num * sizeof(unsigned int),
						GFP_KERNEL);
	if (!adreno_ft_regs_val)
		return -ENOMEM;