Skip to content

Commit

Permalink
pinctrl: msm: fix potential NULL pointer dereference
Browse files Browse the repository at this point in the history
Fix potential NULL pointer dereference with NULL checks.

Change-Id: Ic04209d46dcfe32489d873ee3275f4c5c54bceb3
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
  • Loading branch information
Joonwoo Park authored and javilonas committed May 30, 2015
1 parent 6c78050 commit b033a11
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/pinctrl/pinctrl-msm-tlmm-v3.c
Expand Up @@ -478,11 +478,15 @@ static irqreturn_t msm_tlmm_v3_gp_handle_irq(int irq,
{
unsigned long i;
unsigned int virq = 0;
struct irq_chip *chip;
struct irq_desc *desc = irq_to_desc(irq);
struct irq_chip *chip = irq_desc_get_chip(desc);
struct msm_pintype_info *pinfo = ic_to_pintype(ic);
struct gpio_chip *gc = pintype_get_gc(pinfo);

if (unlikely(!desc))
return IRQ_HANDLED;

chip = irq_desc_get_chip(desc);
chained_irq_enter(chip, desc);
for_each_set_bit(i, ic->enabled_irqs, ic->num_irqs)
{
Expand Down Expand Up @@ -822,6 +826,8 @@ static int msm_tlmm_v3_probe(struct platform_device *pdev)
match = of_match_node(msm_tlmm_v3_dt_match, node);
if (IS_ERR(match))
return PTR_ERR(match);
else if (!match)
return -ENODEV;
pinfo = match->data;
tlmm_desc = devm_kzalloc(&pdev->dev, sizeof(*tlmm_desc), GFP_KERNEL);
if (!tlmm_desc) {
Expand Down

0 comments on commit b033a11

Please sign in to comment.