Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1491538 > unrolled thread

[PATCH] spmi: pmic-arb: Return an error code if sanity check fails

Started byChristophe JAILLET <christophe.jaillet@wanadoo.fr>
First post2016-09-26 22:30 +0200
Last post2016-09-28 00:20 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [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

#1491538 — [PATCH] spmi: pmic-arb: Return an error code if sanity check fails

FromChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Date2016-09-26 22:30 +0200
Subject[PATCH] spmi: pmic-arb: Return an error code if sanity check fails
Message-ID<slKHg-8tj-3@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1492194 — Re: [PATCH] spmi: pmic-arb: Return an error code if sanity check fails

FromStephen Boyd <sboyd@codeaurora.org>
Date2016-09-28 00:20 +0200
SubjectRe: [PATCH] spmi: pmic-arb: Return an error code if sanity check fails
Message-ID<sm8Tf-6PV-11@gated-at.bofh.it>
In reply to#1491538
On 09/26, Christophe JAILLET wrote:
> 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>
> ---

Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>

Looks right, thanks.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web