Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

Commit

Permalink
CORTX-33834: Fixed rpc/conn.c m0_rpc_conn_ha_timer_start() memory leak (
Browse files Browse the repository at this point in the history
#2113)

Expanded cases covered by commit: 52cc7a5

Problem: 
m0_rpc_conn_ha_timer_stop() was finalizing the timer only in the case
when the timer was not armed.

Solution: 
Finalize the timer after the armed timer is stopped using m0_sm_timer_cancel()

Signed-off-by: Abhishek Saha <abhishek.saha@seagate.com>
  • Loading branch information
AbhishekSahaSeagate authored Sep 1, 2022
1 parent 17ef5e7 commit f60c3f8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rpc/conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -1454,8 +1454,9 @@ M0_INTERNAL void m0_rpc_conn_ha_timer_stop(struct m0_rpc_conn *conn)
if (m0_sm_timer_is_armed(&conn->c_ha_timer)) {
M0_LOG(M0_DEBUG, "Cancelling HA timer; rpc conn=%p", conn);
m0_sm_timer_cancel(&conn->c_ha_timer);
} else if (M0_IN(conn->c_ha_timer.tr_timer.t_state,
(M0_TIMER_STOPPED, M0_TIMER_INITED)))
}
if (M0_IN(conn->c_ha_timer.tr_timer.t_state,
(M0_TIMER_STOPPED, M0_TIMER_INITED)))
m0_sm_timer_fini(&conn->c_ha_timer);
}

Expand Down

0 comments on commit f60c3f8

Please sign in to comment.