From: Arvind Yadav Date: Thu, 23 Nov 2017 15:55:30 +0000 (+0530) Subject: extcon: axp288:: Handle return value of platform_get_irq X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=01e1429b877ece6576eb59b74f613b630f859478;p=openwrt%2Fstaging%2Fblogic.git extcon: axp288:: Handle return value of platform_get_irq platform_get_irq() can fail here and we must check its return value. Signed-off-by: Arvind Yadav Signed-off-by: Chanwoo Choi --- diff --git a/drivers/extcon/extcon-axp288.c b/drivers/extcon/extcon-axp288.c index 981fba56bc18..e16a7838cac3 100644 --- a/drivers/extcon/extcon-axp288.c +++ b/drivers/extcon/extcon-axp288.c @@ -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,