On Wed, Jan 15, 2025 at 05:49:44PM +0200, Roger Quadros wrote:
Hi Siddharth,
On 15/01/2025 12:38, Siddharth Vadapalli wrote:
[...]
quoted
Only when the user re-invokes am65_cpsw_nuss_update_tx_rx_chns(),
the cleanup will be performed. This might have to be fixed in the
following manner:
@@ -3416,10 +3416,17 @@ int am65_cpsw_nuss_update_tx_rx_chns(struct am65_cpsw_common *common,
common->tx_ch_num = num_tx;
common->rx_ch_num_flows = num_rx;
ret = am65_cpsw_nuss_init_tx_chns(common);
- if (ret)
+ if (ret) {
+ devm_remove_action(dev, am65_cpsw_nuss_free_tx_chns, common);
+ am65_cpsw_nuss_free_tx_chns(common);
return ret;
+ }
ret = am65_cpsw_nuss_init_rx_chns(common);
+ if (ret) {
+ devm_remove_action(dev, am65_cpsw_nuss_free_rx_chns, common);
+ am65_cpsw_nuss_free_rx_chns(common);
+ }
return ret;
}
Please let me know what you think.
I've already implemented a cleanup series to get rid of devm_add/remove_action,
cleanup probe error path and streamline TX and RQ queue init/cleanup.
I'll send out the series soon as soon as I finish some tests.
Sure, thank you.
Regards,
Siddharth.