[net-next] octeon_ep: Fix error code in probe()

Message ID cd2c5d69-b515-4933-9443-0a8f1b7fc599@moroto.mountain
State New
Headers
Series [net-next] octeon_ep: Fix error code in probe() |

Commit Message

Dan Carpenter Nov. 28, 2023, 1:13 p.m. UTC
  Set the error code if octep_ctrl_net_get_mtu() fails.  Currently the code
returns success.

Fixes: 0a5f8534e398 ("octeon_ep: get max rx packet length from firmware")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/net/ethernet/marvell/octeon_ep/octep_main.c | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Simon Horman Nov. 30, 2023, 6:23 p.m. UTC | #1
On Tue, Nov 28, 2023 at 04:13:19PM +0300, Dan Carpenter wrote:
> Set the error code if octep_ctrl_net_get_mtu() fails.  Currently the code
> returns success.
> 
> Fixes: 0a5f8534e398 ("octeon_ep: get max rx packet length from firmware")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
>  drivers/net/ethernet/marvell/octeon_ep/octep_main.c | 1 +
>  1 file changed, 1 insertion(+)

Thanks Dan,

I had noticed this one too.

Reviewed-by: Simon Horman <horms@kernel.org>

...
  
Jakub Kicinski Dec. 1, 2023, 7:15 a.m. UTC | #2
On Tue, 28 Nov 2023 16:13:19 +0300 Dan Carpenter wrote:
> Set the error code if octep_ctrl_net_get_mtu() fails.  Currently the code
> returns success.
> 
> Fixes: 0a5f8534e398 ("octeon_ep: get max rx packet length from firmware")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

Sathesh, Veerasenareddy, please review. See:
https://docs.kernel.org/next/maintainer/feature-and-driver-maintainers.html#reviews
  
Sathesh B Edara Dec. 1, 2023, 8:55 a.m. UTC | #3
-----Original Message-----
From: Dan Carpenter <dan.carpenter@linaro.org> 
Sent: Tuesday, November 28, 2023 6:43 PM
To: Shinas Rasheed <srasheed@marvell.com>
Cc: Veerasenareddy Burru <vburru@marvell.com>; Sathesh B Edara <sedara@marvell.com>; David S. Miller <davem@davemloft.net>; Eric Dumazet <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; netdev@vger.kernel.org; linux-kernel@vger.kernel.org; kernel-janitors@vger.kernel.org
Subject: [PATCH net-next] octeon_ep: Fix error code in probe()

----------------------------------------------------------------------
Set the error code if octep_ctrl_net_get_mtu() fails.  Currently the code returns success.

Fixes: 0a5f8534e398 ("octeon_ep: get max rx packet length from firmware")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/net/ethernet/marvell/octeon_ep/octep_main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/marvell/octeon_ep/octep_main.c b/drivers/net/ethernet/marvell/octeon_ep/octep_main.c
index 423eec5ff3ad..f2e5c7d80398 100644
--- a/drivers/net/ethernet/marvell/octeon_ep/octep_main.c
+++ b/drivers/net/ethernet/marvell/octeon_ep/octep_main.c
@@ -1383,6 +1383,7 @@ static int octep_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	if (max_rx_pktlen < 0) {
 		dev_err(&octep_dev->pdev->dev,
 			"Failed to get max receive packet size; err = %d\n", max_rx_pktlen);
+		err = max_rx_pktlen;
 		goto register_dev_err;
 	}
 	netdev->min_mtu = OCTEP_MIN_MTU;
--
2.42.0
Reviewed-by: Sathesh B Edara <sedara@marvell.com>
  
patchwork-bot+netdevbpf@kernel.org Dec. 1, 2023, 11 a.m. UTC | #4
Hello:

This patch was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:

On Tue, 28 Nov 2023 16:13:19 +0300 you wrote:
> Set the error code if octep_ctrl_net_get_mtu() fails.  Currently the code
> returns success.
> 
> Fixes: 0a5f8534e398 ("octeon_ep: get max rx packet length from firmware")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
>  drivers/net/ethernet/marvell/octeon_ep/octep_main.c | 1 +
>  1 file changed, 1 insertion(+)

Here is the summary with links:
  - [net-next] octeon_ep: Fix error code in probe()
    https://git.kernel.org/netdev/net-next/c/0cd523ee8642

You are awesome, thank you!
  

Patch

diff --git a/drivers/net/ethernet/marvell/octeon_ep/octep_main.c b/drivers/net/ethernet/marvell/octeon_ep/octep_main.c
index 423eec5ff3ad..f2e5c7d80398 100644
--- a/drivers/net/ethernet/marvell/octeon_ep/octep_main.c
+++ b/drivers/net/ethernet/marvell/octeon_ep/octep_main.c
@@ -1383,6 +1383,7 @@  static int octep_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	if (max_rx_pktlen < 0) {
 		dev_err(&octep_dev->pdev->dev,
 			"Failed to get max receive packet size; err = %d\n", max_rx_pktlen);
+		err = max_rx_pktlen;
 		goto register_dev_err;
 	}
 	netdev->min_mtu = OCTEP_MIN_MTU;