public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] phy: exynos-mipi-video: fix check on array index
@ 2014-05-12 12:56 Antoine Ténart
  2014-05-12 15:07 ` Sylwester Nawrocki
  0 siblings, 1 reply; 2+ messages in thread
From: Antoine Ténart @ 2014-05-12 12:56 UTC (permalink / raw)
  To: kgene.kim, kishon
  Cc: Antoine Ténart, sylvester.nawrocki, linux-arm-kernel,
	linux-samsung-soc, linux-kernel

The phys array is of size EXYNOS_MIPI_PHYS_NUM. Trying to access the
index EXYNOS_MIPI_PHYS_NUM should return an error.

Fixes: 069d2e26e9d6 "phy: Add driver for Exynos MIPI CSIS/DSIM DPHYs"

Signed-off-by: Antoine Ténart <antoine.tenart@free-electrons.com>
---
 drivers/phy/phy-exynos-mipi-video.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/phy/phy-exynos-mipi-video.c b/drivers/phy/phy-exynos-mipi-video.c
index 7f139326a642..ff026689358c 100644
--- a/drivers/phy/phy-exynos-mipi-video.c
+++ b/drivers/phy/phy-exynos-mipi-video.c
@@ -101,7 +101,7 @@ static struct phy *exynos_mipi_video_phy_xlate(struct device *dev,
 {
 	struct exynos_mipi_video_phy *state = dev_get_drvdata(dev);
 
-	if (WARN_ON(args->args[0] > EXYNOS_MIPI_PHYS_NUM))
+	if (WARN_ON(args->args[0] >= EXYNOS_MIPI_PHYS_NUM))
 		return ERR_PTR(-ENODEV);
 
 	return state->phys[args->args[0]].phy;
-- 
1.9.1


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

* Re: [PATCH] phy: exynos-mipi-video: fix check on array index
  2014-05-12 12:56 [PATCH] phy: exynos-mipi-video: fix check on array index Antoine Ténart
@ 2014-05-12 15:07 ` Sylwester Nawrocki
  0 siblings, 0 replies; 2+ messages in thread
From: Sylwester Nawrocki @ 2014-05-12 15:07 UTC (permalink / raw)
  To: Antoine Ténart
  Cc: kgene.kim, kishon, sylvester.nawrocki, linux-arm-kernel,
	linux-samsung-soc, linux-kernel

On 12/05/14 14:56, Antoine Ténart wrote:
> The phys array is of size EXYNOS_MIPI_PHYS_NUM. Trying to access the
> index EXYNOS_MIPI_PHYS_NUM should return an error.
> 
> Fixes: 069d2e26e9d6 "phy: Add driver for Exynos MIPI CSIS/DSIM DPHYs"
> 
> Signed-off-by: Antoine Ténart <antoine.tenart@free-electrons.com>

Thanks for the fix,

Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>

> ---
>  drivers/phy/phy-exynos-mipi-video.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/phy/phy-exynos-mipi-video.c b/drivers/phy/phy-exynos-mipi-video.c
> index 7f139326a642..ff026689358c 100644
> --- a/drivers/phy/phy-exynos-mipi-video.c
> +++ b/drivers/phy/phy-exynos-mipi-video.c
> @@ -101,7 +101,7 @@ static struct phy *exynos_mipi_video_phy_xlate(struct device *dev,
>  {
>  	struct exynos_mipi_video_phy *state = dev_get_drvdata(dev);
>  
> -	if (WARN_ON(args->args[0] > EXYNOS_MIPI_PHYS_NUM))
> +	if (WARN_ON(args->args[0] >= EXYNOS_MIPI_PHYS_NUM))
>  		return ERR_PTR(-ENODEV);
>  
>  	return state->phys[args->args[0]].phy;

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

end of thread, other threads:[~2014-05-12 15:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-12 12:56 [PATCH] phy: exynos-mipi-video: fix check on array index Antoine Ténart
2014-05-12 15:07 ` Sylwester Nawrocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox