]>
Commit | Line | Data |
---|---|---|
81e265ea GKH |
1 | From fb166ba1d7f0a662f7332f4ff660a0d6f4d76915 Mon Sep 17 00:00:00 2001 |
2 | From: Krzysztof Kozlowski <k.kozlowski@samsung.com> | |
3 | Date: Thu, 4 Feb 2016 09:26:35 +0900 | |
4 | Subject: rtc: max77686: Properly handle regmap_irq_get_virq() error code | |
5 | ||
6 | From: Krzysztof Kozlowski <k.kozlowski@samsung.com> | |
7 | ||
8 | commit fb166ba1d7f0a662f7332f4ff660a0d6f4d76915 upstream. | |
9 | ||
10 | The regmap_irq_get_virq() can return 0 or -EINVAL in error conditions | |
11 | but driver checked only for value of 0. | |
12 | ||
13 | This could lead to a cast of -EINVAL to an unsigned int used as a | |
14 | interrupt number for devm_request_threaded_irq(). Although this is not | |
15 | yet fatal (devm_request_threaded_irq() will just fail with -EINVAL) but | |
16 | might be a misleading when diagnosing errors. | |
17 | ||
18 | Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> | |
19 | Fixes: 6f1c1e71d933 ("mfd: max77686: Convert to use regmap_irq") | |
20 | Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com> | |
21 | Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> | |
22 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
23 | ||
24 | --- | |
25 | drivers/rtc/rtc-max77686.c | 2 +- | |
26 | 1 file changed, 1 insertion(+), 1 deletion(-) | |
27 | ||
28 | --- a/drivers/rtc/rtc-max77686.c | |
29 | +++ b/drivers/rtc/rtc-max77686.c | |
30 | @@ -465,7 +465,7 @@ static int max77686_rtc_probe(struct pla | |
31 | ||
32 | info->virq = regmap_irq_get_virq(max77686->rtc_irq_data, | |
33 | MAX77686_RTCIRQ_RTCA1); | |
34 | - if (!info->virq) { | |
35 | + if (info->virq <= 0) { | |
36 | ret = -ENXIO; | |
37 | goto err_rtc; | |
38 | } |