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 <mkshah@codeaurora.org>
tirimbino
Maulik Shah 7 years ago committed by Gerrit - the friendly Code Review server
parent 4b9434e4c1
commit 139aa9844d
  1. 4
      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);
}

Loading…
Cancel
Save