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

Commit e06c3efa authored by Prashant Singh's avatar Prashant Singh
Browse files

drm/msm/sde: Add null pointer sanity checks



Add missing null pointer checks for variables
before referencing them.

Change-Id: I337cb4a199812a4c85cd316da5e265a801253d0b
Signed-off-by: default avatarPrashant Singh <prasin@codeaurora.org>
parent 47d149c3
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
/* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -497,8 +497,11 @@ void sde_core_irq_preinstall(struct sde_kms *sde_kms)
	sde_kms->irq_obj.irq_counts = kcalloc(sde_kms->irq_obj.total_irqs,
			sizeof(atomic_t), GFP_KERNEL);
	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]);
		if (sde_kms->irq_obj.enable_counts)
			atomic_set(&sde_kms->irq_obj.enable_counts[i], 0);
		if (sde_kms->irq_obj.irq_counts)
			atomic_set(&sde_kms->irq_obj.irq_counts[i], 0);
	}
}