net/bnxt: fix HA timer spinlock leak
PATCH 1/1 net/bnxt: fix HA timer spinlock leak
From: Joey Zhong <[email protected]>
ulp_ha_mgr_timer_cb() acquires the global ULP context spinlock via bnxt_ulp_cntxt_entry_acquire(). When myclient_cnt is transiently 0, the function did a bare return without calling bnxt_ulp_cntxt_entry_release(), leaking the lock and deadlocking all subsequent flow operations on the device.
Replace the bare return with goto cb_restart, matching every other error path in the callback: it releases the lock and restarts the timer. Since a zero client count is transient, restarting the timer is the correct behavior, so the misleading "kill timer" log message is updated accordingly.
Fixes 1993b267dbcb ("net/bnxt: cleanup ULP parser and mapper")
Signed-off-by Joey Zhong <[email protected]>
Signed-off-by Manish Kurup <[email protected]>
--- drivers/net/bnxt/tf_ulp/ulp_ha_mgr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_ha_mgr.c +2 -2
@@ -256,8 +256,8 @@ ulp_ha_mgr_timer_cb(void *arg) myclient_cnt =bnxt_ulp_cntxt_num_shared_clients_get (ulp_ctx);if (myclient_cnt ==0 ) {BNXT_DRV_DBG (ERR , -"PANIC Client Count is zero kill timer\n." ); -return ; +"Client Count is zero, skip and restart timer.\n" ); + goto cb_restart; } tfp =bnxt_ulp_cntxt_tfp_get (ulp_ctx,BNXT_ULP_SESSION_TYPE_SHARED_WC );
Signature · 1 line
2.31.1