netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] fjes: Fix an error handling path in fjes_probe()
@ 2022-12-20 20:57 Christophe JAILLET
  2022-12-21  9:59 ` Michal Swiatkowski
  2022-12-22  1:40 ` Jakub Kicinski
  0 siblings, 2 replies; 5+ messages in thread
From: Christophe JAILLET @ 2022-12-20 20:57 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Taku Izumi
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET, netdev

A netif_napi_add() call is hidden in fjes_sw_init(). It should be undone
by a corresponding netif_napi_del() call in the error handling path of the
probe, as already done inthe remove function.

Fixes: 265859309a76 ("fjes: NAPI polling function")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/net/fjes/fjes_main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/fjes/fjes_main.c b/drivers/net/fjes/fjes_main.c
index 2513be6d4e11..01b4c9c6adbd 100644
--- a/drivers/net/fjes/fjes_main.c
+++ b/drivers/net/fjes/fjes_main.c
@@ -1370,7 +1370,7 @@ static int fjes_probe(struct platform_device *plat_dev)
 	adapter->txrx_wq = alloc_workqueue(DRV_NAME "/txrx", WQ_MEM_RECLAIM, 0);
 	if (unlikely(!adapter->txrx_wq)) {
 		err = -ENOMEM;
-		goto err_free_netdev;
+		goto err_del_napi;
 	}
 
 	adapter->control_wq = alloc_workqueue(DRV_NAME "/control",
@@ -1431,6 +1431,8 @@ static int fjes_probe(struct platform_device *plat_dev)
 	destroy_workqueue(adapter->control_wq);
 err_free_txrx_wq:
 	destroy_workqueue(adapter->txrx_wq);
+err_del_napi:
+	netif_napi_del(&adapter->napi);
 err_free_netdev:
 	free_netdev(netdev);
 err_out:
-- 
2.34.1


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

end of thread, other threads:[~2023-01-04 11:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-20 20:57 [PATCH net] fjes: Fix an error handling path in fjes_probe() Christophe JAILLET
2022-12-21  9:59 ` Michal Swiatkowski
2022-12-29 16:34   ` Christophe JAILLET
2023-01-04 11:24     ` Michal Swiatkowski
2022-12-22  1:40 ` 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).