]> www.infradead.org Git - users/hch/configfs.git/commit
net: ethernet: ti: am65-cpsw: avoid devm_alloc_etherdev, fix module removal
authorNicolas Pitre <npitre@baylibre.com>
Fri, 4 Oct 2024 04:10:34 +0000 (00:10 -0400)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 8 Oct 2024 08:30:30 +0000 (10:30 +0200)
commit03c96bc9d3d2d5991ed455d70a67cbafbbc50063
tree06dfdcb1e08fd9329515f625ad92cb23963e08f9
parent47f9605484a89ea14c41f0aa0e9294b7b94d64c0
net: ethernet: ti: am65-cpsw: avoid devm_alloc_etherdev, fix module removal

Usage of devm_alloc_etherdev_mqs() conflicts with
am65_cpsw_nuss_cleanup_ndev() as the same struct net_device instances
get unregistered twice. Switch to alloc_etherdev_mqs() and make sure
am65_cpsw_nuss_cleanup_ndev() unregisters and frees those net_device
instances properly.

With this, it is finally possible to rmmod the driver without oopsing
the kernel.

Fixes: 93a76530316a ("net: ethernet: ti: introduce am65x/j721e gigabit eth subsystem driver")
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Reviewed-by: Roger Quadros <roger@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/ti/am65-cpsw-nuss.c