Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1491538
| From | Christophe JAILLET <christophe.jaillet@wanadoo.fr> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH] spmi: pmic-arb: Return an error code if sanity check fails |
| Date | 2016-09-26 22:30 +0200 |
| Message-ID | <slKHg-8tj-3@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
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>
---
Un-tested
---
drivers/spmi/spmi-pmic-arb.c | 1 +
1 file changed, 1 insertion(+)
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;
}
--
2.7.4
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH] spmi: pmic-arb: Return an error code if sanity check fails Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2016-09-26 22:30 +0200 Re: [PATCH] spmi: pmic-arb: Return an error code if sanity check fails Stephen Boyd <sboyd@codeaurora.org> - 2016-09-28 00:20 +0200
csiph-web