Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1395670

[PATCH v6 5/9] extcon: max8997: Fix handling error code of regmap_irq_get_virq()

From Krzysztof Kozlowski <k.kozlowski@samsung.com>
Newsgroups linux.kernel
Subject [PATCH v6 5/9] extcon: max8997: Fix handling error code of regmap_irq_get_virq()
Date 2016-05-06 09:30 +0200
Message-ID <rvIn0-P0-35@gated-at.bofh.it> (permalink)
References <rvImZ-P0-7@gated-at.bofh.it> <rvIn0-P0-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


The regmap_irq_get_virq() can return negative ERRNO, so its result
should not be stored in unsigned int because error would be ignored.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
---
 drivers/extcon/extcon-max8997.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/extcon/extcon-max8997.c b/drivers/extcon/extcon-max8997.c
index 68754ac2c8ea..0afa3e8b5dc3 100644
--- a/drivers/extcon/extcon-max8997.c
+++ b/drivers/extcon/extcon-max8997.c
@@ -660,11 +660,11 @@ static int max8997_muic_probe(struct platform_device *pdev)
 
 	for (i = 0; i < ARRAY_SIZE(muic_irqs); i++) {
 		struct max8997_muic_irq *muic_irq = &muic_irqs[i];
-		unsigned int virq = 0;
+		int virq = 0;
 
 		virq = regmap_irq_get_virq(max8997->irq_data_muic,
 					muic_irq->irq);
-		if (!virq) {
+		if (virq <= 0) {
 			ret = -EINVAL;
 			goto err_irq;
 		}
-- 
1.9.1

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v6 0/9] mfd: max8997: Add regmap support Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2016-05-06 09:30 +0200
  [PATCH v6 1/9] input: max8997-haptic: Fix NULL pointer dereference Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2016-05-06 09:30 +0200
    [PATCH v6 4/9] mfd: max8997: Change irq names to upper case Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2016-05-06 09:30 +0200
    [PATCH v6 8/9] ARM: dts: exynos: Fix regulator name to avoid forbidden  character on exynos4210-trats Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2016-05-06 09:30 +0200
    [PATCH v6 3/9] mfd: max8997: handle IRQs using regmap Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2016-05-06 09:30 +0200
    [PATCH v6 6/9] rtc: max8997: Check for ERRNO of regmap_irq_get_virq() Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2016-05-06 09:30 +0200
      Re: [PATCH v6 6/9] rtc: max8997: Check for ERRNO of  regmap_irq_get_virq() Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2016-05-07 08:50 +0200
    [PATCH v6 9/9] ARM: dts: exynos: Add interrupt line to MAX8997 PMIC on  exynos4210-trats Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2016-05-06 09:30 +0200
    [PATCH v6 5/9] extcon: max8997: Fix handling error code of  regmap_irq_get_virq() Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2016-05-06 09:30 +0200
      Re: [PATCH v6 5/9] extcon: max8997: Fix handling error code of  regmap_irq_get_virq() Chanwoo Choi <cw00.choi@samsung.com> - 2016-05-10 03:30 +0200
    [PATCH v6 7/9] extcon: max8997: Fix inconsistent indenting Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2016-05-06 09:40 +0200
      Re: [PATCH v6 7/9] extcon: max8997: Fix inconsistent indenting Chanwoo Choi <cw00.choi@samsung.com> - 2016-05-10 03:30 +0200
    Re: [PATCH v6 2/9] mfd: max8997: Use regmap to access registers Jacek Anaszewski <j.anaszewski@samsung.com> - 2016-05-06 10:10 +0200
    Re: [PATCH v6 1/9] input: max8997-haptic: Fix NULL pointer  dereference Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2016-05-09 18:40 +0200
  Re: [PATCH v6 0/9] mfd: max8997: Add regmap support Lee Jones <lee.jones@linaro.org> - 2016-05-09 09:40 +0200

csiph-web