Skip to content

Commit

Permalink
extcon: axp288:: Handle return value of platform_get_irq
Browse files Browse the repository at this point in the history
platform_get_irq() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
  • Loading branch information
Arvind Yadav authored and Chanwoo Choi committed Jan 3, 2018
1 parent c7eb47f commit 01e1429
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/extcon/extcon-axp288.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,9 @@ static int axp288_extcon_probe(struct platform_device *pdev)

for (i = 0; i < EXTCON_IRQ_END; i++) {
pirq = platform_get_irq(pdev, i);
if (pirq < 0)
return pirq;

info->irq[i] = regmap_irq_get_virq(info->regmap_irqc, pirq);
if (info->irq[i] < 0) {
dev_err(&pdev->dev,
Expand Down

0 comments on commit 01e1429

Please sign in to comment.