Thread View: linux.kernel.netdev
2 messages
2 total messages
Started by b.lane130
Mon, 23 Nov 2026 10:30
[PATCH net] net: octeon_mgmt: Add cleanup operations for octeon_mgmt_init_phy()
Author: b.lane130
Date: Mon, 23 Nov 2026 10:30
Date: Mon, 23 Nov 2026 10:30
42 lines
18471 bytes
18471 bytes
From: Bruce Lane <b.lane130@outlook.com>
The error path in octeon_mgmt_open() misses the cleanup
operations for octeon_mgmt_init_phy() if request_irq()
fails. Add an error label and the corresponding cleanup
functions.
Fixes: eeae05aa2169 ("netdev: octeon_mgmt: Add support for 1Gig ports.")
Signed-off-by: Bruce Lane <b.lane130@outlook.com>
---
drivers/net/ethernet/cavium/octeon/octeon_mgmt.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/cavium/octeon/octeon_mgmt.c b/drivers/net/ethernet/cavium/octeon/octeon_mgmt.c
index bb72c0833721..514ee9a180f2 100644
--- a/drivers/net/ethernet/cavium/octeon/octeon_mgmt.c
+++ b/drivers/net/ethernet/cavium/octeon/octeon_mgmt.c
@@ -1073,7 +1073,7 @@ static int octeon_mgmt_open(struct net_device *netdev)
/* Read the PHY to find the mode of the interface. */
if (octeon_mgmt_init_phy(netdev)) {
dev_err(p->dev, "Cannot initialize PHY on MIX%d.\n", p->port);
- goto err_noirq;
+ goto err_nophy;
}
/* Set the mode of the interface, RGMII/MII. */
@@ -1223,7 +1223,12 @@ static int octeon_mgmt_open(struct net_device *netdev)
napi_enable(&p->napi);
return 0;
+
err_noirq:
+ if (netdev->phydev)
+ phy_disconnect(netdev->phydev);
+ netif_carrier_off(netdev);
+err_nophy:
octeon_mgmt_reset_hw(p);
dma_unmap_single(p->dev, p->rx_ring_handle,
ring_size_to_bytes(OCTEON_MGMT_RX_RING_SIZE),
--
2.25.1
Re: [PATCH net] net: octeon_mgmt: Add cleanup operations for octeon_mgmt_init_phy()
Author: Andrew Lunn
Date: Mon, 23 Nov 2026 15:02
Date: Mon, 23 Nov 2026 15:02
20 lines
8646 bytes
8646 bytes
On Mon, Nov 23, 2026 at 06:30:22PM +0800, b.lane130@outlook.com wrote:
> From: Bruce Lane <b.lane130@outlook.com>
>
> The error path in octeon_mgmt_open() misses the cleanup
> operations for octeon_mgmt_init_phy() if request_irq()
> fails. Add an error label and the corresponding cleanup
> functions.
>
> Fixes: eeae05aa2169 ("netdev: octeon_mgmt: Add support for 1Gig ports.")
Who does this bother?
https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
Andrew
---
pw-bot: cr
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads