From 139aa9844d4b702e7a3bfaf2d63c0d0cf2d1bc57 Mon Sep 17 00:00:00 2001 From: Maulik Shah Date: Thu, 8 Feb 2018 09:54:14 +0530 Subject: [PATCH] irqchip: qcom: pdc: Correct irq_data argument for irq_set_irqchip_state GIC-v2 driver gets base address from irq_data in gic_poke_irq. Passing current irq_data to irq_set_irqchip_state can result in NULL pointer dereference. This issue is not seen on GIC-v3 driver since base address is calculated from global variable. Correctly pass parent_data as argument to irq_set_irqchip_state and irq_get_irqchip_state. Change-Id: Ie63561e002b0e0c1cb2404a20fa3d7151cf0b48a Signed-off-by: Maulik Shah --- drivers/irqchip/qcom/pdc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/irqchip/qcom/pdc.c b/drivers/irqchip/qcom/pdc.c index f7284bdaf87a..f4e9799fa4f5 100644 --- a/drivers/irqchip/qcom/pdc.c +++ b/drivers/irqchip/qcom/pdc.c @@ -99,14 +99,14 @@ static inline int pdc_enable_intr(struct irq_data *d, bool on) static int qcom_pdc_gic_get_irqchip_state(struct irq_data *d, enum irqchip_irq_state which, bool *state) { - return d->parent_data->chip->irq_get_irqchip_state(d, + return d->parent_data->chip->irq_get_irqchip_state(d->parent_data, which, state); } static int qcom_pdc_gic_set_irqchip_state(struct irq_data *d, enum irqchip_irq_state which, bool value) { - return d->parent_data->chip->irq_set_irqchip_state(d, + return d->parent_data->chip->irq_set_irqchip_state(d->parent_data, which, value); }