Re: [PATCH] phy: exynos5-usbdrd: Fix off-by-one valid value checking for args->args[0]

2015-03-02 Thread Vivek Gautam

Hi,

On Friday, February 27, 2015 9:14 PM "Axel Lin"  wrote:

Current code uses args->args[0] as array subscript of phy_drd->phys[].
So the valid value range for args->args[0] is 0 ... EXYNOS5_DRDPHYS_NUM - 
1.


Signed-off-by: Axel Lin 


Reviewed by: Vivek Gautam 


---
drivers/phy/phy-exynos5-usbdrd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/phy/phy-exynos5-usbdrd.c 
b/drivers/phy/phy-exynos5-usbdrd.c

index 0437401..e2a0be7 100644
--- a/drivers/phy/phy-exynos5-usbdrd.c
+++ b/drivers/phy/phy-exynos5-usbdrd.c
@@ -531,7 +531,7 @@ static struct phy *exynos5_usbdrd_phy_xlate(struct 
device *dev,

{
 struct exynos5_usbdrd_phy *phy_drd = dev_get_drvdata(dev);

- if (WARN_ON(args->args[0] > EXYNOS5_DRDPHYS_NUM))
+ if (WARN_ON(args->args[0] >= EXYNOS5_DRDPHYS_NUM))
 return ERR_PTR(-ENODEV);

 return phy_drd->phys[args->args[0]].phy;
--
1.9.1



BRs
Vivek 


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] phy: exynos5-usbdrd: Fix off-by-one valid value checking for args-args[0]

2015-03-02 Thread Vivek Gautam

Hi,

On Friday, February 27, 2015 9:14 PM Axel Lin axel@ingics.com wrote:

Current code uses args-args[0] as array subscript of phy_drd-phys[].
So the valid value range for args-args[0] is 0 ... EXYNOS5_DRDPHYS_NUM - 
1.


Signed-off-by: Axel Lin axel@ingics.com


Reviewed by: Vivek Gautam gautam.vi...@samsung.com


---
drivers/phy/phy-exynos5-usbdrd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/phy/phy-exynos5-usbdrd.c 
b/drivers/phy/phy-exynos5-usbdrd.c

index 0437401..e2a0be7 100644
--- a/drivers/phy/phy-exynos5-usbdrd.c
+++ b/drivers/phy/phy-exynos5-usbdrd.c
@@ -531,7 +531,7 @@ static struct phy *exynos5_usbdrd_phy_xlate(struct 
device *dev,

{
 struct exynos5_usbdrd_phy *phy_drd = dev_get_drvdata(dev);

- if (WARN_ON(args-args[0]  EXYNOS5_DRDPHYS_NUM))
+ if (WARN_ON(args-args[0] = EXYNOS5_DRDPHYS_NUM))
 return ERR_PTR(-ENODEV);

 return phy_drd-phys[args-args[0]].phy;
--
1.9.1



BRs
Vivek 


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] phy: exynos5-usbdrd: Fix off-by-one valid value checking for args->args[0]

2015-02-27 Thread Axel Lin
Current code uses args->args[0] as array subscript of phy_drd->phys[].
So the valid value range for args->args[0] is 0 ... EXYNOS5_DRDPHYS_NUM - 1.

Signed-off-by: Axel Lin 
---
 drivers/phy/phy-exynos5-usbdrd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/phy/phy-exynos5-usbdrd.c b/drivers/phy/phy-exynos5-usbdrd.c
index 0437401..e2a0be7 100644
--- a/drivers/phy/phy-exynos5-usbdrd.c
+++ b/drivers/phy/phy-exynos5-usbdrd.c
@@ -531,7 +531,7 @@ static struct phy *exynos5_usbdrd_phy_xlate(struct device 
*dev,
 {
struct exynos5_usbdrd_phy *phy_drd = dev_get_drvdata(dev);
 
-   if (WARN_ON(args->args[0] > EXYNOS5_DRDPHYS_NUM))
+   if (WARN_ON(args->args[0] >= EXYNOS5_DRDPHYS_NUM))
return ERR_PTR(-ENODEV);
 
return phy_drd->phys[args->args[0]].phy;
-- 
1.9.1



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] phy: exynos5-usbdrd: Fix off-by-one valid value checking for args-args[0]

2015-02-27 Thread Axel Lin
Current code uses args-args[0] as array subscript of phy_drd-phys[].
So the valid value range for args-args[0] is 0 ... EXYNOS5_DRDPHYS_NUM - 1.

Signed-off-by: Axel Lin axel@ingics.com
---
 drivers/phy/phy-exynos5-usbdrd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/phy/phy-exynos5-usbdrd.c b/drivers/phy/phy-exynos5-usbdrd.c
index 0437401..e2a0be7 100644
--- a/drivers/phy/phy-exynos5-usbdrd.c
+++ b/drivers/phy/phy-exynos5-usbdrd.c
@@ -531,7 +531,7 @@ static struct phy *exynos5_usbdrd_phy_xlate(struct device 
*dev,
 {
struct exynos5_usbdrd_phy *phy_drd = dev_get_drvdata(dev);
 
-   if (WARN_ON(args-args[0]  EXYNOS5_DRDPHYS_NUM))
+   if (WARN_ON(args-args[0] = EXYNOS5_DRDPHYS_NUM))
return ERR_PTR(-ENODEV);
 
return phy_drd-phys[args-args[0]].phy;
-- 
1.9.1



--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/