netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mlxbf_gige: Add missing check for platform_get_irq
@ 2023-06-01  6:19 Jiasheng Jiang
  2023-06-01  6:27 ` Jakub Kicinski
  2023-06-02 14:56 ` David Thompson
  0 siblings, 2 replies; 10+ messages in thread
From: Jiasheng Jiang @ 2023-06-01  6:19 UTC (permalink / raw)
  To: davem, edumazet, kuba, pabeni, davthompson, asmaa, mkl, limings
  Cc: netdev, linux-kernel, Jiasheng Jiang

Add the check for the return value of the platform_get_irq and
return error if it fails.

Fixes: f92e1869d74e ("Add Mellanox BlueField Gigabit Ethernet driver")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
---
 drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c
index 694de9513b9f..a38e1c68874f 100644
--- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c
+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c
@@ -427,6 +427,10 @@ static int mlxbf_gige_probe(struct platform_device *pdev)
 	priv->error_irq = platform_get_irq(pdev, MLXBF_GIGE_ERROR_INTR_IDX);
 	priv->rx_irq = platform_get_irq(pdev, MLXBF_GIGE_RECEIVE_PKT_INTR_IDX);
 	priv->llu_plu_irq = platform_get_irq(pdev, MLXBF_GIGE_LLU_PLU_INTR_IDX);
+	if (priv->error_irq < 0 || priv->rx_irq < 0 || priv->llu_plu_irq < 0) {
+		err = -ENODEV;
+		goto out;
+	}
 
 	phy_irq = acpi_dev_gpio_irq_get_by(ACPI_COMPANION(&pdev->dev), "phy-gpios", 0);
 	if (phy_irq < 0) {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread
* Re: [PATCH] mlxbf_gige: Add missing check for platform_get_irq
@ 2023-06-02  2:34 Jiasheng Jiang
  0 siblings, 0 replies; 10+ messages in thread
From: Jiasheng Jiang @ 2023-06-02  2:34 UTC (permalink / raw)
  To: simon.horman
  Cc: kuba, davem, edumazet, pabeni, davthompson, asmaa, mkl, limings,
	netdev, linux-kernel, Jiasheng Jiang

On Thu, Jun 01, 2023 at 23:08:54 +0800, Simon Horman wrote:
> Let's take a step back.
> 
> The script is here, so you can take a look at what it does.
> And I dare say that changes can be proposed.
> 
>   https://github.com/kuba-moo/nipa/blob/master/tests/patch/cc_maintainers/test.py
> 
> I'd also say that the problem here is that Liming Sun <limings@nvidia.com>
> appears in the above mentioned commit that is being fixed.
> 
> I think that get_maintainer will dell you this if you run it
> on your patch. Which is what the script appears to do.
> 
> Locally, I see:
> 
>   $ ./scripts/get_maintainer.pl --git-min-percent 25 this.patch
>   "David S. Miller" <davem@davemloft.net> (maintainer:NETWORKING DRIVERS,blamed_fixes:1/1=100%)
>   Eric Dumazet <edumazet@google.com> (maintainer:NETWORKING DRIVERS)
>   Jakub Kicinski <kuba@kernel.org> (maintainer:NETWORKING DRIVERS,commit_signer:5/5=100%)
>   Paolo Abeni <pabeni@redhat.com> (maintainer:NETWORKING DRIVERS)
>   Asmaa Mnebhi <asmaa@nvidia.com> (commit_signer:4/5=80%,blamed_fixes:1/1=100%)
>   David Thompson <davthompson@nvidia.com> (commit_signer:4/5=80%,authored:4/5=80%,added_lines:94/95=99%,removed_lines:19/20=95%,blamed_fixes:1/1=100%)
>   Liming Sun <limings@nvidia.com> (blamed_fixes:1/1=100%)
>   netdev@vger.kernel.org (open list:NETWORKING DRIVERS)
>   linux-kernel@vger.kernel.org (open list)
> 
> N.B.: The script excludes linux-kernel@vger.kernel.org

I have got it. I will run the script on the patch.

> 
> 
> As an aside. This patch is missing v2.
> 
>   Subject: [PATCH v2] ...

The patch is not changed. I only add a recipient.
Therefore, I think it is not a v2.

Thanks,
Jiasheng


^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: [PATCH] mlxbf_gige: Add missing check for platform_get_irq
@ 2023-06-02  2:13 Jiasheng Jiang
  0 siblings, 0 replies; 10+ messages in thread
From: Jiasheng Jiang @ 2023-06-02  2:13 UTC (permalink / raw)
  To: kuba
  Cc: davem, edumazet, pabeni, davthompson, asmaa, mkl, limings, netdev,
	linux-kernel, Jiasheng Jiang

On Thu, 1 Jun 2023 23:54:02 +0800 Jakub Kicinski wrote:
> On Thu,  1 Jun 2023 14:58:08 +0800 Jiasheng Jiang wrote:
>> According to the documentation of submitting patches
>> (Link: https://docs.kernel.org/process/submitting-patches.html),
>> I used "scripts/get_maintainer.pl" to gain the appropriate recipients
>> for my patch.
>> However, the "limings@nvidia.com" is not contained in the following list.
> 
> And I told you already to run the script on the _patch_ not on the file
> path.
> 
> $ ./scripts/get_maintainer.pl 0001-mlxbf_gige-Add-missing-check-for-platform_get_irq.patch
> "David S. Miller" <davem@davemloft.net> (maintainer:NETWORKING DRIVERS,blamed_fixes:1/1=100%)
> Eric Dumazet <edumazet@google.com> (maintainer:NETWORKING DRIVERS)
> Jakub Kicinski <kuba@kernel.org> (maintainer:NETWORKING DRIVERS,commit_signer:5/6=83%,authored:1/6=17%,removed_lines:1/20=5%)
> Paolo Abeni <pabeni@redhat.com> (maintainer:NETWORKING DRIVERS)
> Asmaa Mnebhi <asmaa@nvidia.com> (commit_signer:4/6=67%,blamed_fixes:1/1=100%)
> David Thompson <davthompson@nvidia.com> (commit_signer:4/6=67%,authored:4/6=67%,added_lines:94/99=95%,removed_lines:19/20=95%,blamed_fixes:1/1=100%)
> Marc Kleine-Budde <mkl@pengutronix.de> (commit_signer:1/6=17%)
> Jiasheng Jiang <jiasheng@iscas.ac.cn> (commit_signer:1/6=17%,authored:1/6=17%)
> vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
> Liming Sun <limings@nvidia.com> (blamed_fixes:1/1=100%)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> netdev@vger.kernel.org (open list:NETWORKING DRIVERS)
> linux-kernel@vger.kernel.org (open list)

I have got it. I will run the script on the patch.

Thanks,
Jiang


^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: [PATCH] mlxbf_gige: Add missing check for platform_get_irq
@ 2023-06-01  6:58 Jiasheng Jiang
  2023-06-01 15:08 ` Simon Horman
  2023-06-01 15:54 ` Jakub Kicinski
  0 siblings, 2 replies; 10+ messages in thread
From: Jiasheng Jiang @ 2023-06-01  6:58 UTC (permalink / raw)
  To: kuba
  Cc: davem, edumazet, pabeni, davthompson, asmaa, mkl, limings, netdev,
	linux-kernel, Jiasheng Jiang

On Thu,  1 Jun 2023 14:27:21 +0800 Jakub Kicinski wrote:
> On Thu,  1 Jun 2023 14:19:08 +0800 Jiasheng Jiang wrote:
>> Add the check for the return value of the platform_get_irq and
>> return error if it fails.
>> 
>> Fixes: f92e1869d74e ("Add Mellanox BlueField Gigabit Ethernet driver")
>> Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
> 
> BTW I looked thru my sent messages and I complained to you about not
> CCing people at least twice before. Please start paying attention or
> we'll stop paying attention to your patches.

According to the documentation of submitting patches
(Link: https://docs.kernel.org/process/submitting-patches.html),
I used "scripts/get_maintainer.pl" to gain the appropriate recipients
for my patch.
However, the "limings@nvidia.com" is not contained in the following list.

"David S. Miller" <davem@davemloft.net> (maintainer:NETWORKING DRIVERS)
Eric Dumazet <edumazet@google.com> (maintainer:NETWORKING DRIVERS)
Jakub Kicinski <kuba@kernel.org> (maintainer:NETWORKING DRIVERS,commit_signer:5/6=83%,authored:1/6=17%,removed_lines:1/20=5%)
Paolo Abeni <pabeni@redhat.com> (maintainer:NETWORKING DRIVERS)
Asmaa Mnebhi <asmaa@nvidia.com> (commit_signer:4/6=67%)
David Thompson <davthompson@nvidia.com> (commit_signer:4/6=67%,authored:4/6=67%,added_lines:94/99=95%,removed_lines:19/20=95%)
Marc Kleine-Budde <mkl@pengutronix.de> (commit_signer:1/6=17%)
netdev@vger.kernel.org (open list:NETWORKING DRIVERS)
linux-kernel@vger.kernel.org (open list)

There may be a problem with the script.
The best way is to fix it.

Thanks,
Jiang


^ permalink raw reply	[flat|nested] 10+ messages in thread
* [PATCH] mlxbf_gige: Add missing check for platform_get_irq
@ 2023-05-31  7:54 Jiasheng Jiang
  2023-06-01  5:52 ` Jakub Kicinski
  0 siblings, 1 reply; 10+ messages in thread
From: Jiasheng Jiang @ 2023-05-31  7:54 UTC (permalink / raw)
  To: davem, edumazet, kuba, pabeni, davthompson, asmaa, mkl
  Cc: netdev, linux-kernel, Jiasheng Jiang

Add the check for the return value of the platform_get_irq and
return error if it fails.

Fixes: f92e1869d74e ("Add Mellanox BlueField Gigabit Ethernet driver")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
---
 drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c
index 694de9513b9f..a38e1c68874f 100644
--- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c
+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c
@@ -427,6 +427,10 @@ static int mlxbf_gige_probe(struct platform_device *pdev)
 	priv->error_irq = platform_get_irq(pdev, MLXBF_GIGE_ERROR_INTR_IDX);
 	priv->rx_irq = platform_get_irq(pdev, MLXBF_GIGE_RECEIVE_PKT_INTR_IDX);
 	priv->llu_plu_irq = platform_get_irq(pdev, MLXBF_GIGE_LLU_PLU_INTR_IDX);
+	if (priv->error_irq < 0 || priv->rx_irq < 0 || priv->llu_plu_irq < 0) {
+		err = -ENODEV;
+		goto out;
+	}
 
 	phy_irq = acpi_dev_gpio_irq_get_by(ACPI_COMPANION(&pdev->dev), "phy-gpios", 0);
 	if (phy_irq < 0) {
-- 
2.25.1


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

end of thread, other threads:[~2023-06-02 14:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-01  6:19 [PATCH] mlxbf_gige: Add missing check for platform_get_irq Jiasheng Jiang
2023-06-01  6:27 ` Jakub Kicinski
2023-06-02 14:56 ` David Thompson
  -- strict thread matches above, loose matches on Subject: below --
2023-06-02  2:34 Jiasheng Jiang
2023-06-02  2:13 Jiasheng Jiang
2023-06-01  6:58 Jiasheng Jiang
2023-06-01 15:08 ` Simon Horman
2023-06-01 15:54 ` Jakub Kicinski
2023-05-31  7:54 Jiasheng Jiang
2023-06-01  5:52 ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).