Commit-ID: 2827a418ca1b23e432e62c9b3d0e7cf3255dfe88 Gitweb: http://git.kernel.org/tip/2827a418ca1b23e432e62c9b3d0e7cf3255dfe88 Author: Alexandru Moise <00moses.alexander00@xxxxxxxxx> AuthorDate: Tue, 19 Sep 2017 22:04:12 +0200 Committer: Thomas Gleixner <tglx@xxxxxxxxxxxxx> CommitDate: Mon, 25 Sep 2017 16:40:31 +0200 genirq: Check __free_irq() return value for NULL __free_irq() can return a NULL irqaction for example when trying to free already-free IRQ, but the callsite unconditionally dereferences the returned pointer. Fix this by adding a check and return NULL. Signed-off-by: Alexandru Moise <00moses.alexander00@xxxxxxxxx> Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx> Link: https://lkml.kernel.org/r/20170919200412.GA29985@xxxxxxxxx --- kernel/irq/manage.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index 573dc52..d00132b 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; -- To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
![]() |