diff options
author | Antoine Ténart <antoine.tenart@free-electrons.com> | 2014-05-12 14:56:28 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-06-30 20:11:52 -0700 |
commit | e248558984dc61187b315fc493ad397bbb4c15cb (patch) | |
tree | f5d15592816243594607328237be5c804ebc8751 /drivers/phy | |
parent | 57a30a41fd5191c6eef3e868e2ae2d365c74b0f2 (diff) |
phy: exynos-mipi-video: fix check on array index
commit 98c3b32229f2685c13436b652b8959c99dfc5a31 upstream.
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>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/phy')
-rw-r--r-- | drivers/phy/phy-exynos-mipi-video.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/phy/phy-exynos-mipi-video.c b/drivers/phy/phy-exynos-mipi-video.c index 7f139326a64..ff026689358 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; |