[PATCH] genirq: check __free_irq()'s return value for NULL
From: Alexandru Moise
Date: Tue Sep 19 2017 - 16:04:27 EST
__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.
Signed-off-by: Alexandru Moise <00moses.alexander00@xxxxxxxxx>
---
kernel/irq/manage.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 573dc52b0806..649bc34521da 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -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;
--
2.14.1