Author: tuexen
Date: Tue Oct  6 11:08:52 2020
New Revision: 366482
URL: https://svnweb.freebsd.org/changeset/base/366482

Log:
  Remove dead stores reported by clang static code analysis
  
  MFC after:            3 days

Modified:
  head/sys/netinet/sctp_input.c
  head/sys/netinet/sctp_output.c
  head/sys/netinet/sctp_pcb.c
  head/sys/netinet/sctputil.c

Modified: head/sys/netinet/sctp_input.c
==============================================================================
--- head/sys/netinet/sctp_input.c       Tue Oct  6 10:51:47 2020        
(r366481)
+++ head/sys/netinet/sctp_input.c       Tue Oct  6 11:08:52 2020        
(r366482)
@@ -4116,7 +4116,6 @@ sctp_handle_packet_dropped(struct sctp_pktdrop_chunk *
        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 *
        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;

Modified: head/sys/netinet/sctp_output.c
==============================================================================
--- head/sys/netinet/sctp_output.c      Tue Oct  6 10:51:47 2020        
(r366481)
+++ head/sys/netinet/sctp_output.c      Tue Oct  6 11:08:52 2020        
(r366482)
@@ -8793,7 +8793,7 @@ no_data_fill:
                                 * 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;

Modified: head/sys/netinet/sctp_pcb.c
==============================================================================
--- head/sys/netinet/sctp_pcb.c Tue Oct  6 10:51:47 2020        (r366481)
+++ head/sys/netinet/sctp_pcb.c Tue Oct  6 11:08:52 2020        (r366482)
@@ -4345,7 +4345,7 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockadd
        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);

Modified: head/sys/netinet/sctputil.c
==============================================================================
--- head/sys/netinet/sctputil.c Tue Oct  6 10:51:47 2020        (r366481)
+++ head/sys/netinet/sctputil.c Tue Oct  6 11:08:52 2020        (r366482)
@@ -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, s
            ("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) {
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to