summaryrefslogtreecommitdiff
path: root/drivers/phy/phy-exynos-mipi-video.c
diff options
context:
space:
mode:
authorAntoine Ténart <antoine.tenart@free-electrons.com>2014-05-12 12:56:28 (GMT)
committerKishon Vijay Abraham I <kishon@ti.com>2014-05-12 13:32:02 (GMT)
commit98c3b32229f2685c13436b652b8959c99dfc5a31 (patch)
tree7e7c77d9bb5eb7ef8abbc28595f9e9daed31ac90 /drivers/phy/phy-exynos-mipi-video.c
parentfe04e4297e6eab014a2cf152319b9f361df07faf (diff)
downloadlinux-98c3b32229f2685c13436b652b8959c99dfc5a31.tar.xz
phy: exynos-mipi-video: fix check on array index
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>
Diffstat (limited to 'drivers/phy/phy-exynos-mipi-video.c')
-rw-r--r--drivers/phy/phy-exynos-mipi-video.c2
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 7f13932..ff02668 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;