Skip to contentSkip to conversation

kernel/irq/manage: check return value of irq_data_get_irq_chip()

PATCH New Li Zhong 1 participant 1 message Sep 17, 2022 IRQ

lore
Share & tools
lore

Li Zhong

author
#0 lore raw

PATCH 1/1 kernel/irq/manage: check return value of irq_data_get_irq_chip()

Check the return value chip of irq_data_get_irq_chip(), which could be NULL and result in null pointer dereference if unchecked.

---
 kernel/irq/manage.c | 2 ++
 1 file changed, 2 insertions(+)
kernel/irq/manage.c +2 -0
index 40fe7806cc8c..1f967050338b 100644
@@ -202,6 +202,8 @@ static void irq_validate_effective_affinity(struct irq_data *data)
 
 	if (!cpumask_empty(m))
 		return;
+	if (!chip)
+		return;
 	pr_warn_once("irq_chip %s did not update eff. affinity mask of irq %u\n",
 		     chip->name, data->irq);
 }
Signature · 1 line
2.25.1