Home Home > GIT Browse > SLE15
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-05-17 17:01:28 +0200
committerTakashi Iwai <tiwai@suse.de>2019-05-17 17:01:34 +0200
commit738ff9132221b3337886188c6d931a1c52f3e452 (patch)
tree0ce0d7b5036b4ffd92b61448b7080cadcf96f64c
parentb63afbee424f9d63fc3a086cf577c0a05377a1fd (diff)
power: supply: axp288_charger: Fix unchecked return value
(bsc#1051510).
-rw-r--r--patches.drivers/power-supply-axp288_charger-Fix-unchecked-return-val.patch46
-rw-r--r--series.conf1
2 files changed, 47 insertions, 0 deletions
diff --git a/patches.drivers/power-supply-axp288_charger-Fix-unchecked-return-val.patch b/patches.drivers/power-supply-axp288_charger-Fix-unchecked-return-val.patch
new file mode 100644
index 0000000000..115d9f2bb3
--- /dev/null
+++ b/patches.drivers/power-supply-axp288_charger-Fix-unchecked-return-val.patch
@@ -0,0 +1,46 @@
+From c3422ad5f84a66739ec6a37251ca27638c85b6be Mon Sep 17 00:00:00 2001
+From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
+Date: Mon, 18 Mar 2019 11:14:39 -0500
+Subject: [PATCH] power: supply: axp288_charger: Fix unchecked return value
+Git-commit: c3422ad5f84a66739ec6a37251ca27638c85b6be
+Patch-mainline: v5.2-rc1
+References: bsc#1051510
+
+Currently there is no check on platform_get_irq() return value
+in case it fails, hence never actually reporting any errors and
+causing unexpected behavior when using such value as argument
+for function regmap_irq_get_virq().
+
+Fix this by adding a proper check, a message reporting any errors
+and returning *pirq*
+
+Addresses-coverity-id: 1443940 ("Improper use of negative value")
+Fixes: 843735b788a4 ("power: axp288_charger: axp288 charger driver")
+Cc: stable@vger.kernel.org
+Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
+Reviewed-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
+Acked-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ drivers/power/supply/axp288_charger.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/drivers/power/supply/axp288_charger.c b/drivers/power/supply/axp288_charger.c
+index f8c6da9277b3..00b961890a38 100644
+--- a/drivers/power/supply/axp288_charger.c
++++ b/drivers/power/supply/axp288_charger.c
+@@ -833,6 +833,10 @@ static int axp288_charger_probe(struct platform_device *pdev)
+ /* Register charger interrupts */
+ for (i = 0; i < CHRG_INTR_END; i++) {
+ pirq = platform_get_irq(info->pdev, i);
++ if (pirq < 0) {
++ dev_err(&pdev->dev, "Failed to get IRQ: %d\n", pirq);
++ return pirq;
++ }
+ info->irq[i] = regmap_irq_get_virq(info->regmap_irqc, pirq);
+ if (info->irq[i] < 0) {
+ dev_warn(&info->pdev->dev,
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index fc92c2f3b1..3151ad9033 100644
--- a/series.conf
+++ b/series.conf
@@ -22015,6 +22015,7 @@
patches.drivers/PCI-Mark-Atheros-AR9462-to-avoid-bus-reset.patch
patches.drivers/backlight-lm3630a-Return-0-on-success-in-update_stat.patch
patches.fixes/crypto-caam-fix-caam_dump_sg-that-iterates-through-s.patch
+ patches.drivers/power-supply-axp288_charger-Fix-unchecked-return-val.patch
patches.drm/drm-i915-fbc-disable-framebuffer-compression-on-Gemi.patch
patches.drm/drm-bridge-adv7511-Fix-low-refresh-rate-selection.patch
patches.drivers/thermal-cpu_cooling-Actually-trace-CPU-load-in-therm.patch