Skip to contentSkip to conversation

genirq: check __free_irq()'s return value for NULL

PATCH New Alexandru Moise 1 participant 1 message Sep 19, 2017 IRQ

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 genirq: check __free_irq()'s return value for NULL

__free_irq() can return a NULL irqaction for example when trying to free already-free IRQ. Fix this by adding a check and return NULL.

---
 kernel/irq/manage.c | 4 ++++
 1 file changed, 4 insertions(+)
kernel/irq/manage.c +4 -0
index 573dc52b0806..649bc34521da 100644
@@ -1643,6 +1643,10 @@ const void *free_irq(unsigned int irq, void *dev_id)
 #endif
 
 	action = __free_irq(irq, dev_id);
+
+	if (!action)
+		return NULL;
+
 	devname = action->name;
 	kfree(action);
 	return devname;
Signature · 1 line
2.14.1