From: Christophe JAILLET Date: Mon, 26 Sep 2016 20:24:46 +0000 (+0200) Subject: spmi: pmic-arb: Return an error code if sanity check fails X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e98cc182a06af3b8e91d6d719708db07045d78c4;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Greg Kroah-Hartman --- 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; }