summaryrefslogtreecommitdiffstats
path: root/drivers/spmi/spmi-pmic-arb.c
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2016-09-26 22:24:46 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-09-27 12:43:34 +0200
commite98cc182a06af3b8e91d6d719708db07045d78c4 (patch)
treea5bffbce018a44fe16e7ea96f946d72c22e4d4ba /drivers/spmi/spmi-pmic-arb.c
parente7fca5d860aeeb1e606448f5191cea8d925cc7a3 (diff)
downloadtalos-op-linux-e98cc182a06af3b8e91d6d719708db07045d78c4.tar.gz
talos-op-linux-e98cc182a06af3b8e91d6d719708db07045d78c4.zip
spmi: pmic-arb: Return an error code if sanity check fails
If the test 'if (channel > 5)' is true, then we will return 'err' which is known to be 0 at this point. Return -EINVAL instead. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/spmi/spmi-pmic-arb.c')
-rw-r--r--drivers/spmi/spmi-pmic-arb.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/spmi/spmi-pmic-arb.c b/drivers/spmi/spmi-pmic-arb.c
index aca282d45421..5ec3a595dc7d 100644
--- a/drivers/spmi/spmi-pmic-arb.c
+++ b/drivers/spmi/spmi-pmic-arb.c
@@ -954,6 +954,7 @@ static int spmi_pmic_arb_probe(struct platform_device *pdev)
if (channel > 5) {
dev_err(&pdev->dev, "invalid channel (%u) specified.\n",
channel);
+ err = -EINVAL;
goto err_put_ctrl;
}
OpenPOWER on IntegriCloud