Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Christophe JAILLET and committed by
Greg Kroah-Hartman
e98cc182 e7fca5d8

+1
+1
drivers/spmi/spmi-pmic-arb.c
··· 954 954 if (channel > 5) { 955 955 dev_err(&pdev->dev, "invalid channel (%u) specified.\n", 956 956 channel); 957 + err = -EINVAL; 957 958 goto err_put_ctrl; 958 959 } 959 960