OSDN Git Service

power: supply: axp288_charger: Fix unchecked return value
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Mon, 18 Mar 2019 16:14:39 +0000 (11:14 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 21 May 2019 16:48:56 +0000 (18:48 +0200)
commit4bae1935546a935ee11a9f4da2610d6226970f41
tree787cf2e80e03c27e38eb9bcef6bba521d2c8f0f5
parentf8646ad101e0dff3aa950743152417e54517e9a2
power: supply: axp288_charger: Fix unchecked return value

commit c3422ad5f84a66739ec6a37251ca27638c85b6be upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/power/supply/axp288_charger.c