* [PATCH] genirq: check __free_irq()'s return value for NULL
@ 2017-09-19 20:04 Alexandru Moise
0 siblings, 0 replies; only message in thread
From: Alexandru Moise @ 2017-09-19 20:04 UTC (permalink / raw)
To: tglx, linux-kernel
__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@gmail.com>
---
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2017-09-19 20:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-19 20:04 [PATCH] genirq: check __free_irq()'s return value for NULL Alexandru Moise
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.