Remove dead stores reported by clang static code analysis
MFC after: 3 days
This commit is contained in:
parent
c52a3a8c90
commit
6176f9d6df
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=366482
@ -4116,7 +4116,6 @@ sctp_handle_packet_dropped(struct sctp_pktdrop_chunk *cp,
|
||||
struct sctp_idata_chunk *idata_chunk;
|
||||
uint32_t bottle_bw, on_queue;
|
||||
uint32_t offset, chk_len;
|
||||
uint16_t trunc_len;
|
||||
uint16_t pktdrp_len;
|
||||
uint8_t pktdrp_flags;
|
||||
|
||||
@ -4126,13 +4125,10 @@ sctp_handle_packet_dropped(struct sctp_pktdrop_chunk *cp,
|
||||
pktdrp_len = ntohs(cp->ch.chunk_length);
|
||||
KASSERT(limit <= pktdrp_len, ("Inconsistent limit"));
|
||||
if (pktdrp_flags & SCTP_PACKET_TRUNCATED) {
|
||||
trunc_len = ntohs(cp->trunc_len);
|
||||
if (trunc_len <= pktdrp_len - sizeof(struct sctp_pktdrop_chunk)) {
|
||||
if (ntohs(cp->trunc_len) <= pktdrp_len - sizeof(struct sctp_pktdrop_chunk)) {
|
||||
/* The peer plays games with us. */
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
trunc_len = 0;
|
||||
}
|
||||
limit -= sizeof(struct sctp_pktdrop_chunk);
|
||||
offset = 0;
|
||||
|
@ -8793,7 +8793,7 @@ sctp_med_chunk_output(struct sctp_inpcb *inp,
|
||||
* the top of the for, but just to make sure
|
||||
* I will reset these again here.
|
||||
*/
|
||||
ctl_cnt = bundle_at = 0;
|
||||
ctl_cnt = 0;
|
||||
continue; /* This takes us back to the
|
||||
* for() for the nets. */
|
||||
} else {
|
||||
@ -9392,7 +9392,7 @@ sctp_chunk_retransmission(struct sctp_inpcb *inp,
|
||||
uint32_t dmtu = 0;
|
||||
|
||||
SCTP_TCB_LOCK_ASSERT(stcb);
|
||||
tmr_started = ctl_cnt = bundle_at = error = 0;
|
||||
tmr_started = ctl_cnt = 0;
|
||||
no_fragmentflg = 1;
|
||||
fwd_tsn = 0;
|
||||
*cnt_out = 0;
|
||||
|
@ -4345,7 +4345,7 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockaddr *firstaddr,
|
||||
LIST_INSERT_HEAD(head, stcb, sctp_asocs);
|
||||
SCTP_INP_INFO_WUNLOCK();
|
||||
|
||||
if ((err = sctp_add_remote_addr(stcb, firstaddr, NULL, port, SCTP_DO_SETSCOPE, SCTP_ALLOC_ASOC))) {
|
||||
if (sctp_add_remote_addr(stcb, firstaddr, NULL, port, SCTP_DO_SETSCOPE, SCTP_ALLOC_ASOC)) {
|
||||
/* failure.. memory error? */
|
||||
if (asoc->strmout) {
|
||||
SCTP_FREE(asoc->strmout, SCTP_M_STRMO);
|
||||
|
@ -1725,7 +1725,6 @@ sctp_timeout_handler(void *t)
|
||||
net = (struct sctp_nets *)tmr->net;
|
||||
CURVNET_SET((struct vnet *)tmr->vnet);
|
||||
NET_EPOCH_ENTER(et);
|
||||
did_output = 1;
|
||||
released_asoc_reference = false;
|
||||
|
||||
#ifdef SCTP_AUDITING_ENABLED
|
||||
@ -1994,7 +1993,6 @@ sctp_timeout_handler(void *t)
|
||||
op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code),
|
||||
"Shutdown guard timer expired");
|
||||
sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED);
|
||||
did_output = true;
|
||||
/* no need to unlock on tcb its gone */
|
||||
goto out_decr;
|
||||
case SCTP_TIMER_TYPE_AUTOCLOSE:
|
||||
@ -2071,7 +2069,6 @@ sctp_timeout_handler(void *t)
|
||||
#ifdef INVARIANTS
|
||||
panic("Unknown timer type %d", type);
|
||||
#else
|
||||
did_output = false;
|
||||
goto out;
|
||||
#endif
|
||||
}
|
||||
@ -2155,7 +2152,6 @@ sctp_timer_start(int t_type, struct sctp_inpcb *inp, struct sctp_tcb *stcb,
|
||||
("sctp_timer_start of type %d: inp = %p, stcb->sctp_ep %p",
|
||||
t_type, stcb, stcb->sctp_ep));
|
||||
tmr = NULL;
|
||||
to_ticks = 0;
|
||||
if (stcb != NULL) {
|
||||
SCTP_TCB_LOCK_ASSERT(stcb);
|
||||
} else if (inp != NULL) {
|
||||
|
Loading…
Reference in New Issue
Block a user