public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] net: ethernet: ti: am65-cpsw: fix freeing IRQ in am65_cpsw_nuss_remove_tx_chns()
@ 2025-01-14 16:44 Roger Quadros
  2025-01-14 17:12 ` Simon Horman
  2025-01-15  5:18 ` Siddharth Vadapalli
  0 siblings, 2 replies; 12+ messages in thread
From: Roger Quadros @ 2025-01-14 16:44 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Grygorii Strashko, Siddharth Vadapalli
  Cc: srk, netdev, linux-kernel, Roger Quadros

When getting the IRQ we use k3_udma_glue_rx_get_irq() which returns
negative error value on error. So not NULL check is not sufficient
to deteremine if IRQ is valid. Check that IRQ is greater then zero
to ensure it is valid.

Fixes: 93a76530316a ("net: ethernet: ti: introduce am65x/j721e gigabit eth subsystem driver")
Signed-off-by: Roger Quadros <rogerq@kernel.org>
---
 drivers/net/ethernet/ti/am65-cpsw-nuss.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
index 5465bf872734..e1de45fb18ae 100644
--- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c
+++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
@@ -2248,7 +2248,7 @@ static void am65_cpsw_nuss_remove_tx_chns(struct am65_cpsw_common *common)
 	for (i = 0; i < common->tx_ch_num; i++) {
 		struct am65_cpsw_tx_chn *tx_chn = &common->tx_chns[i];
 
-		if (tx_chn->irq)
+		if (tx_chn->irq > 0)
 			devm_free_irq(dev, tx_chn->irq, tx_chn);
 
 		netif_napi_del(&tx_chn->napi_tx);

---
base-commit: 5bc55a333a2f7316b58edc7573e8e893f7acb532
change-id: 20250114-am65-cpsw-fix-tx-irq-free-846ac55ee6e1

Best regards,
-- 
Roger Quadros <rogerq@kernel.org>


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

end of thread, other threads:[~2025-01-16 13:00 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-14 16:44 [PATCH net] net: ethernet: ti: am65-cpsw: fix freeing IRQ in am65_cpsw_nuss_remove_tx_chns() Roger Quadros
2025-01-14 17:12 ` Simon Horman
2025-01-15  5:18 ` Siddharth Vadapalli
2025-01-15 10:04   ` Roger Quadros
2025-01-15 10:38     ` Siddharth Vadapalli
2025-01-15 15:49       ` Roger Quadros
2025-01-15 16:38         ` Roger Quadros
2025-01-16  5:15           ` Siddharth Vadapalli
2025-01-16 11:47             ` Roger Quadros
2025-01-16 12:10               ` Siddharth Vadapalli
2025-01-16 13:00                 ` Roger Quadros
2025-01-16  5:09         ` Siddharth Vadapalli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox