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

Commit a2b0e7c7 authored by Krishna Manikandan's avatar Krishna Manikandan Committed by Gerrit - the friendly Code Review server
Browse files

disp: msm: sde: add proper null checks



This change adds proper null checks after using
kcalloc and returns early to avoid accessing null ptr.

Change-Id: I948ad37eb120e00c5f6e3ae2e3b967819cbd233b
Signed-off-by: default avatarSamantha Tran <samtran@codeaurora.org>
Signed-off-by: default avatarKrishna Manikandan <mkrishn@codeaurora.org>
parent ffbc14e4
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -496,6 +496,10 @@ void sde_core_irq_preinstall(struct sde_kms *sde_kms)
			sizeof(atomic_t), GFP_KERNEL);
	sde_kms->irq_obj.irq_counts = kcalloc(sde_kms->irq_obj.total_irqs,
			sizeof(atomic_t), GFP_KERNEL);
	if (!sde_kms->irq_obj.irq_cb_tbl || !sde_kms->irq_obj.enable_counts
			|| !sde_kms->irq_obj.irq_counts)
		return;

	for (i = 0; i < sde_kms->irq_obj.total_irqs; i++) {
		if (sde_kms->irq_obj.irq_cb_tbl)
			INIT_LIST_HEAD(&sde_kms->irq_obj.irq_cb_tbl[i]);