net: remove redundant check for timer pending state before del_timer
As in del_timer() there has already placed a timer_pending() function to check whether the timer to be deleted is pending or not, it's unnecessary to check timer pending state again before del_timer() is called. Signed-off-by: Ying Xue <ying.xue@windriver.com> Cc: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
2b3c9a850c
commit
25cc4ae913
@@ -674,10 +674,8 @@ static void sctp_cmd_t3_rtx_timers_stop(sctp_cmd_seq_t *cmds,
|
||||
|
||||
list_for_each_entry(t, &asoc->peer.transport_addr_list,
|
||||
transports) {
|
||||
if (timer_pending(&t->T3_rtx_timer) &&
|
||||
del_timer(&t->T3_rtx_timer)) {
|
||||
if (del_timer(&t->T3_rtx_timer))
|
||||
sctp_transport_put(t);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1517,7 +1515,7 @@ static int sctp_cmd_interpreter(sctp_event_t event_type,
|
||||
|
||||
case SCTP_CMD_TIMER_STOP:
|
||||
timer = &asoc->timers[cmd->obj.to];
|
||||
if (timer_pending(timer) && del_timer(timer))
|
||||
if (del_timer(timer))
|
||||
sctp_association_put(asoc);
|
||||
break;
|
||||
|
||||
|
Reference in New Issue
Block a user