Messages in this thread Patch in this message | | | From | RAGHU Halharvi <> | Subject | [PATCH] genirq:Dereference desc after null pointer check | Date | Tue, 17 Jul 2018 04:33:09 +0530 |
| |
* Remove unchecked dereferencing of *desc & assigning it local irq variable * Move the assignement after proper check of *desc for NULL pointer.
Signed-off-by: RAGHU Halharvi <raghuhack78@gmail.com> --- kernel/irq/manage.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index facfecfc543c..33c77eb4fdb6 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -1557,15 +1557,16 @@ EXPORT_SYMBOL_GPL(setup_irq); */ static struct irqaction *__free_irq(struct irq_desc *desc, void *dev_id) { - unsigned irq = desc->irq_data.irq; + unsigned int irq; struct irqaction *action, **action_ptr; unsigned long flags; - WARN(in_interrupt(), "Trying to free IRQ %d from IRQ context!\n", irq); if (!desc) return NULL; + irq = desc->irq_data.irq; + WARN(in_interrupt(), "Trying to free IRQ %d from IRQ context!\n", irq); mutex_lock(&desc->request_mutex); chip_bus_lock(desc); raw_spin_lock_irqsave(&desc->lock, flags); -- 2.17.1
| |