All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] regulator: add check index of wm8350->pmic.pdev[]
  2009-06-15 20:30 [PATCH] regulator: add check index of wm8350->pmic.pdev[] Roel Kluin
@ 2009-06-15 18:38 ` Mark Brown
  2009-06-16  9:15 ` Liam Girdwood
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2009-06-15 18:38 UTC (permalink / raw)
  To: Roel Kluin; +Cc: lrg, LKML, Andrew Morton

On Mon, Jun 15, 2009 at 10:30:39PM +0200, Roel Kluin wrote:
> Ensure that reg is within the bounds of array wm8350->pmic.pdev[].
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>

Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] regulator: add check index of wm8350->pmic.pdev[]
@ 2009-06-15 20:30 Roel Kluin
  2009-06-15 18:38 ` Mark Brown
  2009-06-16  9:15 ` Liam Girdwood
  0 siblings, 2 replies; 3+ messages in thread
From: Roel Kluin @ 2009-06-15 20:30 UTC (permalink / raw)
  To: lrg; +Cc: LKML, Andrew Morton

Ensure that reg is within the bounds of array wm8350->pmic.pdev[].

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/drivers/regulator/wm8350-regulator.c b/drivers/regulator/wm8350-regulator.c
index 771eca1..c806259 100644
--- a/drivers/regulator/wm8350-regulator.c
+++ b/drivers/regulator/wm8350-regulator.c
@@ -1419,6 +1419,8 @@ int wm8350_register_regulator(struct wm8350 *wm8350, int reg,
 {
 	struct platform_device *pdev;
 	int ret;
+	if (reg < 0 || reg >= NUM_WM8350_REGULATORS)
+		return -EINVAL;
 
 	if (wm8350->pmic.pdev[reg])
 		return -EBUSY;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] regulator: add check index of wm8350->pmic.pdev[]
  2009-06-15 20:30 [PATCH] regulator: add check index of wm8350->pmic.pdev[] Roel Kluin
  2009-06-15 18:38 ` Mark Brown
@ 2009-06-16  9:15 ` Liam Girdwood
  1 sibling, 0 replies; 3+ messages in thread
From: Liam Girdwood @ 2009-06-16  9:15 UTC (permalink / raw)
  To: Roel Kluin; +Cc: LKML, Andrew Morton

On Mon, 2009-06-15 at 22:30 +0200, Roel Kluin wrote:
> Ensure that reg is within the bounds of array wm8350->pmic.pdev[].
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> diff --git a/drivers/regulator/wm8350-regulator.c b/drivers/regulator/wm8350-regulator.c
> index 771eca1..c806259 100644
> --- a/drivers/regulator/wm8350-regulator.c
> +++ b/drivers/regulator/wm8350-regulator.c
> @@ -1419,6 +1419,8 @@ int wm8350_register_regulator(struct wm8350 *wm8350, int reg,
>  {
>  	struct platform_device *pdev;
>  	int ret;
> +	if (reg < 0 || reg >= NUM_WM8350_REGULATORS)
> +		return -EINVAL;
>  
>  	if (wm8350->pmic.pdev[reg])
>  		return -EBUSY;

Applied.

Thanks.

Liam


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-06-16  9:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-15 20:30 [PATCH] regulator: add check index of wm8350->pmic.pdev[] Roel Kluin
2009-06-15 18:38 ` Mark Brown
2009-06-16  9:15 ` Liam Girdwood

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.