diff options
| author | Roger Quadros <[email protected]> | 2025-01-17 14:06:33 +0000 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2025-01-20 22:57:26 +0000 |
| commit | 681eb2beb3efe21e630bcc4881595e3b42dd7948 (patch) | |
| tree | de6a67b62b8d53a871750cb08b638387bc28b852 /net/unix/garbage.c | |
| parent | Merge branch 'ipv6-convert-rtm_-new-del-addr-and-more-to-per-netns-rtnl' (diff) | |
| download | kernel-681eb2beb3efe21e630bcc4881595e3b42dd7948.tar.gz kernel-681eb2beb3efe21e630bcc4881595e3b42dd7948.zip | |
net: ethernet: ti: am65-cpsw: ensure proper channel cleanup in error path
We are missing netif_napi_del() and am65_cpsw_nuss_free_tx/rx_chns()
in error path when am65_cpsw_nuss_init_tx/rx_chns() is used anywhere
other than at probe(). i.e. am65_cpsw_nuss_update_tx_rx_chns and
am65_cpsw_nuss_resume()
As reported, in am65_cpsw_nuss_update_tx_rx_chns(),
if am65_cpsw_nuss_init_tx_chns() partially fails then
devm_add_action(dev, am65_cpsw_nuss_free_tx_chns,..) is added
but the cleanup via am65_cpsw_nuss_free_tx_chns() will not run.
Same issue exists for am65_cpsw_nuss_init_tx/rx_chns() failures
in am65_cpsw_nuss_resume() as well.
This would otherwise require more instances of devm_add/remove_action
and is clearly more of a distraction than any benefit.
So, drop devm_add/remove_action for am65_cpsw_nuss_free_tx/rx_chns()
and call am65_cpsw_nuss_free_tx/rx_chns() and netif_napi_del()
where required.
Reported-by: Siddharth Vadapalli <[email protected]>
Closes: https://lore.kernel.org/all/m4rhkzcr7dlylxr54udyt6lal5s2q4krrvmyay6gzgzhcu4q2c@r34snfumzqxy/
Signed-off-by: Roger Quadros <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'net/unix/garbage.c')
0 files changed, 0 insertions, 0 deletions
