All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] peci: fix error check return value of platform_get_irq()
@ 2022-04-12  9:01 ` cgel.zte
  0 siblings, 0 replies; 9+ messages in thread
From: cgel.zte @ 2022-04-12  9:01 UTC (permalink / raw)
  To: iwona.winiarska, joel, andrew
  Cc: jae.hyun.yoo, linux-aspeed, openbmc, Zeal Robot, linux-kernel,
	pierre-louis.bossart, Lv Ruyi, linux-arm-kernel

From: Lv Ruyi <lv.ruyi@zte.com.cn>

platform_get_irq() return negative value on failure, so null check of
priv->irq is incorrect. Fix it by comparing whether it is less than zero.

Fixes: a85e4c52086c ("peci: Add peci-aspeed controller driver")
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
---
 drivers/peci/controller/peci-aspeed.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/peci/controller/peci-aspeed.c b/drivers/peci/controller/peci-aspeed.c
index 1925ddc13f00..731c5d8f75c6 100644
--- a/drivers/peci/controller/peci-aspeed.c
+++ b/drivers/peci/controller/peci-aspeed.c
@@ -523,7 +523,7 @@ static int aspeed_peci_probe(struct platform_device *pdev)
 		return PTR_ERR(priv->base);
 
 	priv->irq = platform_get_irq(pdev, 0);
-	if (!priv->irq)
+	if (priv->irq < 0)
 		return priv->irq;
 
 	ret = devm_request_irq(&pdev->dev, priv->irq, aspeed_peci_irq_handler,
-- 
2.25.1


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

* [PATCH] peci: fix error check return value of platform_get_irq()
@ 2022-04-12  9:01 ` cgel.zte
  0 siblings, 0 replies; 9+ messages in thread
From: cgel.zte @ 2022-04-12  9:01 UTC (permalink / raw)
  To: iwona.winiarska, joel, andrew
  Cc: jae.hyun.yoo, pierre-louis.bossart, linux-aspeed, openbmc,
	linux-arm-kernel, linux-kernel, Lv Ruyi, Zeal Robot

From: Lv Ruyi <lv.ruyi@zte.com.cn>

platform_get_irq() return negative value on failure, so null check of
priv->irq is incorrect. Fix it by comparing whether it is less than zero.

Fixes: a85e4c52086c ("peci: Add peci-aspeed controller driver")
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
---
 drivers/peci/controller/peci-aspeed.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/peci/controller/peci-aspeed.c b/drivers/peci/controller/peci-aspeed.c
index 1925ddc13f00..731c5d8f75c6 100644
--- a/drivers/peci/controller/peci-aspeed.c
+++ b/drivers/peci/controller/peci-aspeed.c
@@ -523,7 +523,7 @@ static int aspeed_peci_probe(struct platform_device *pdev)
 		return PTR_ERR(priv->base);
 
 	priv->irq = platform_get_irq(pdev, 0);
-	if (!priv->irq)
+	if (priv->irq < 0)
 		return priv->irq;
 
 	ret = devm_request_irq(&pdev->dev, priv->irq, aspeed_peci_irq_handler,
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH] peci: fix error check return value of platform_get_irq()
@ 2022-04-12  9:01 ` cgel.zte
  0 siblings, 0 replies; 9+ messages in thread
From: cgel.zte @ 2022-04-12  9:01 UTC (permalink / raw)
  To: iwona.winiarska, joel, andrew
  Cc: jae.hyun.yoo, pierre-louis.bossart, linux-aspeed, openbmc,
	linux-arm-kernel, linux-kernel, Lv Ruyi, Zeal Robot

From: Lv Ruyi <lv.ruyi@zte.com.cn>

platform_get_irq() return negative value on failure, so null check of
priv->irq is incorrect. Fix it by comparing whether it is less than zero.

Fixes: a85e4c52086c ("peci: Add peci-aspeed controller driver")
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
---
 drivers/peci/controller/peci-aspeed.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/peci/controller/peci-aspeed.c b/drivers/peci/controller/peci-aspeed.c
index 1925ddc13f00..731c5d8f75c6 100644
--- a/drivers/peci/controller/peci-aspeed.c
+++ b/drivers/peci/controller/peci-aspeed.c
@@ -523,7 +523,7 @@ static int aspeed_peci_probe(struct platform_device *pdev)
 		return PTR_ERR(priv->base);
 
 	priv->irq = platform_get_irq(pdev, 0);
-	if (!priv->irq)
+	if (priv->irq < 0)
 		return priv->irq;
 
 	ret = devm_request_irq(&pdev->dev, priv->irq, aspeed_peci_irq_handler,
-- 
2.25.1


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

* Re: [PATCH] peci: fix error check return value of platform_get_irq()
  2022-04-12  9:01 ` cgel.zte
  (?)
@ 2022-04-12 21:12   ` Winiarska, Iwona
  -1 siblings, 0 replies; 9+ messages in thread
From: Winiarska, Iwona @ 2022-04-12 21:12 UTC (permalink / raw)
  To: andrew, cgel.zte, joel
  Cc: lv.ruyi, jae.hyun.yoo, zealci, linux-aspeed, linux-kernel,
	linux-arm-kernel, pierre-louis.bossart, openbmc

On Tue, 2022-04-12 at 09:01 +0000, cgel.zte@gmail.com wrote:
> From: Lv Ruyi <lv.ruyi@zte.com.cn>

Thanks for the fix. Can we prefix the subject with "peci: aspeed:"? Just to
distinguish changes related to specific controller from the ones touching peci-
core.

> 
> platform_get_irq() return negative value on failure, so null check of
> priv->irq is incorrect. Fix it by comparing whether it is less than zero.
> 
> Fixes: a85e4c52086c ("peci: Add peci-aspeed controller driver")
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>

Reviewed-by: Iwona Winiarska <iwona.winiarska@intel.com>

-Iwona

> ---
>  drivers/peci/controller/peci-aspeed.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/peci/controller/peci-aspeed.c
> b/drivers/peci/controller/peci-aspeed.c
> index 1925ddc13f00..731c5d8f75c6 100644
> --- a/drivers/peci/controller/peci-aspeed.c
> +++ b/drivers/peci/controller/peci-aspeed.c
> @@ -523,7 +523,7 @@ static int aspeed_peci_probe(struct platform_device *pdev)
>                 return PTR_ERR(priv->base);
>  
>         priv->irq = platform_get_irq(pdev, 0);
> -       if (!priv->irq)
> +       if (priv->irq < 0)
>                 return priv->irq;
>  
>         ret = devm_request_irq(&pdev->dev, priv->irq, aspeed_peci_irq_handler,
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] peci: fix error check return value of platform_get_irq()
@ 2022-04-12 21:12   ` Winiarska, Iwona
  0 siblings, 0 replies; 9+ messages in thread
From: Winiarska, Iwona @ 2022-04-12 21:12 UTC (permalink / raw)
  To: andrew, cgel.zte, joel
  Cc: jae.hyun.yoo, linux-aspeed, openbmc, lv.ruyi, linux-kernel,
	pierre-louis.bossart, zealci, linux-arm-kernel

On Tue, 2022-04-12 at 09:01 +0000, cgel.zte@gmail.com wrote:
> From: Lv Ruyi <lv.ruyi@zte.com.cn>

Thanks for the fix. Can we prefix the subject with "peci: aspeed:"? Just to
distinguish changes related to specific controller from the ones touching peci-
core.

> 
> platform_get_irq() return negative value on failure, so null check of
> priv->irq is incorrect. Fix it by comparing whether it is less than zero.
> 
> Fixes: a85e4c52086c ("peci: Add peci-aspeed controller driver")
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>

Reviewed-by: Iwona Winiarska <iwona.winiarska@intel.com>

-Iwona

> ---
>  drivers/peci/controller/peci-aspeed.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/peci/controller/peci-aspeed.c
> b/drivers/peci/controller/peci-aspeed.c
> index 1925ddc13f00..731c5d8f75c6 100644
> --- a/drivers/peci/controller/peci-aspeed.c
> +++ b/drivers/peci/controller/peci-aspeed.c
> @@ -523,7 +523,7 @@ static int aspeed_peci_probe(struct platform_device *pdev)
>                 return PTR_ERR(priv->base);
>  
>         priv->irq = platform_get_irq(pdev, 0);
> -       if (!priv->irq)
> +       if (priv->irq < 0)
>                 return priv->irq;
>  
>         ret = devm_request_irq(&pdev->dev, priv->irq, aspeed_peci_irq_handler,

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

* Re: [PATCH] peci: fix error check return value of platform_get_irq()
@ 2022-04-12 21:12   ` Winiarska, Iwona
  0 siblings, 0 replies; 9+ messages in thread
From: Winiarska, Iwona @ 2022-04-12 21:12 UTC (permalink / raw)
  To: andrew, cgel.zte, joel
  Cc: lv.ruyi, jae.hyun.yoo, zealci, linux-aspeed, linux-kernel,
	linux-arm-kernel, pierre-louis.bossart, openbmc

On Tue, 2022-04-12 at 09:01 +0000, cgel.zte@gmail.com wrote:
> From: Lv Ruyi <lv.ruyi@zte.com.cn>

Thanks for the fix. Can we prefix the subject with "peci: aspeed:"? Just to
distinguish changes related to specific controller from the ones touching peci-
core.

> 
> platform_get_irq() return negative value on failure, so null check of
> priv->irq is incorrect. Fix it by comparing whether it is less than zero.
> 
> Fixes: a85e4c52086c ("peci: Add peci-aspeed controller driver")
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>

Reviewed-by: Iwona Winiarska <iwona.winiarska@intel.com>

-Iwona

> ---
>  drivers/peci/controller/peci-aspeed.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/peci/controller/peci-aspeed.c
> b/drivers/peci/controller/peci-aspeed.c
> index 1925ddc13f00..731c5d8f75c6 100644
> --- a/drivers/peci/controller/peci-aspeed.c
> +++ b/drivers/peci/controller/peci-aspeed.c
> @@ -523,7 +523,7 @@ static int aspeed_peci_probe(struct platform_device *pdev)
>                 return PTR_ERR(priv->base);
>  
>         priv->irq = platform_get_irq(pdev, 0);
> -       if (!priv->irq)
> +       if (priv->irq < 0)
>                 return priv->irq;
>  
>         ret = devm_request_irq(&pdev->dev, priv->irq, aspeed_peci_irq_handler,

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

* [PATCH v2] peci: aspeed: fix error check return value of platform_get_irq()
  2022-04-12 21:12   ` Winiarska, Iwona
  (?)
@ 2022-04-13  1:04     ` cgel.zte
  -1 siblings, 0 replies; 9+ messages in thread
From: cgel.zte @ 2022-04-13  1:04 UTC (permalink / raw)
  To: iwona.winiarska
  Cc: andrew, cgel.zte, jae.hyun.yoo, joel, linux-arm-kernel,
	linux-aspeed, linux-kernel, lv.ruyi, openbmc,
	pierre-louis.bossart, Zeal Robot

From: Lv Ruyi <lv.ruyi@zte.com.cn>

platform_get_irq() return negative value on failure, so null check of
priv->irq is incorrect. Fix it by comparing whether it is less than zero.

Fixes: a85e4c52086c ("peci: Add peci-aspeed controller driver")
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
---
v2: prefix the subject with "peci: aspeed:"
---
 drivers/peci/controller/peci-aspeed.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/peci/controller/peci-aspeed.c b/drivers/peci/controller/peci-aspeed.c
index 1925ddc13f00..731c5d8f75c6 100644
--- a/drivers/peci/controller/peci-aspeed.c
+++ b/drivers/peci/controller/peci-aspeed.c
@@ -523,7 +523,7 @@ static int aspeed_peci_probe(struct platform_device *pdev)
 		return PTR_ERR(priv->base);
 
 	priv->irq = platform_get_irq(pdev, 0);
-	if (!priv->irq)
+	if (priv->irq < 0)
 		return priv->irq;
 
 	ret = devm_request_irq(&pdev->dev, priv->irq, aspeed_peci_irq_handler,
-- 
2.25.1


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

* [PATCH v2] peci: aspeed: fix error check return value of platform_get_irq()
@ 2022-04-13  1:04     ` cgel.zte
  0 siblings, 0 replies; 9+ messages in thread
From: cgel.zte @ 2022-04-13  1:04 UTC (permalink / raw)
  To: iwona.winiarska
  Cc: jae.hyun.yoo, linux-aspeed, andrew, cgel.zte, lv.ruyi,
	Zeal Robot, linux-kernel, pierre-louis.bossart, joel, openbmc,
	linux-arm-kernel

From: Lv Ruyi <lv.ruyi@zte.com.cn>

platform_get_irq() return negative value on failure, so null check of
priv->irq is incorrect. Fix it by comparing whether it is less than zero.

Fixes: a85e4c52086c ("peci: Add peci-aspeed controller driver")
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
---
v2: prefix the subject with "peci: aspeed:"
---
 drivers/peci/controller/peci-aspeed.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/peci/controller/peci-aspeed.c b/drivers/peci/controller/peci-aspeed.c
index 1925ddc13f00..731c5d8f75c6 100644
--- a/drivers/peci/controller/peci-aspeed.c
+++ b/drivers/peci/controller/peci-aspeed.c
@@ -523,7 +523,7 @@ static int aspeed_peci_probe(struct platform_device *pdev)
 		return PTR_ERR(priv->base);
 
 	priv->irq = platform_get_irq(pdev, 0);
-	if (!priv->irq)
+	if (priv->irq < 0)
 		return priv->irq;
 
 	ret = devm_request_irq(&pdev->dev, priv->irq, aspeed_peci_irq_handler,
-- 
2.25.1


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

* [PATCH v2] peci: aspeed: fix error check return value of platform_get_irq()
@ 2022-04-13  1:04     ` cgel.zte
  0 siblings, 0 replies; 9+ messages in thread
From: cgel.zte @ 2022-04-13  1:04 UTC (permalink / raw)
  To: iwona.winiarska
  Cc: andrew, cgel.zte, jae.hyun.yoo, joel, linux-arm-kernel,
	linux-aspeed, linux-kernel, lv.ruyi, openbmc,
	pierre-louis.bossart, Zeal Robot

From: Lv Ruyi <lv.ruyi@zte.com.cn>

platform_get_irq() return negative value on failure, so null check of
priv->irq is incorrect. Fix it by comparing whether it is less than zero.

Fixes: a85e4c52086c ("peci: Add peci-aspeed controller driver")
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
---
v2: prefix the subject with "peci: aspeed:"
---
 drivers/peci/controller/peci-aspeed.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/peci/controller/peci-aspeed.c b/drivers/peci/controller/peci-aspeed.c
index 1925ddc13f00..731c5d8f75c6 100644
--- a/drivers/peci/controller/peci-aspeed.c
+++ b/drivers/peci/controller/peci-aspeed.c
@@ -523,7 +523,7 @@ static int aspeed_peci_probe(struct platform_device *pdev)
 		return PTR_ERR(priv->base);
 
 	priv->irq = platform_get_irq(pdev, 0);
-	if (!priv->irq)
+	if (priv->irq < 0)
 		return priv->irq;
 
 	ret = devm_request_irq(&pdev->dev, priv->irq, aspeed_peci_irq_handler,
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2022-04-13  1:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-12  9:01 [PATCH] peci: fix error check return value of platform_get_irq() cgel.zte
2022-04-12  9:01 ` cgel.zte
2022-04-12  9:01 ` cgel.zte
2022-04-12 21:12 ` Winiarska, Iwona
2022-04-12 21:12   ` Winiarska, Iwona
2022-04-12 21:12   ` Winiarska, Iwona
2022-04-13  1:04   ` [PATCH v2] peci: aspeed: " cgel.zte
2022-04-13  1:04     ` cgel.zte
2022-04-13  1:04     ` cgel.zte

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.