Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[firefly-linux-kernel-4.4.55.git] / net / sctp / outqueue.c
index 9bcdbd02d77713a5973dd9afd71a9c4783919648..32a4625fef7798f782859f3e9f6bda2979235dd9 100644 (file)
@@ -217,8 +217,6 @@ void sctp_outq_init(struct sctp_association *asoc, struct sctp_outq *q)
        q->outstanding_bytes = 0;
        q->empty = 1;
        q->cork  = 0;
-
-       q->malloced = 0;
        q->out_qlen = 0;
 }
 
@@ -295,10 +293,6 @@ void sctp_outq_free(struct sctp_outq *q)
 {
        /* Throw away leftover chunks. */
        __sctp_outq_teardown(q);
-
-       /* If we were kmalloc()'d, free the memory.  */
-       if (q->malloced)
-               kfree(q);
 }
 
 /* Put a new chunk in an sctp_outq.  */
@@ -707,11 +701,10 @@ redo:
 /* Cork the outqueue so queued chunks are really queued. */
 int sctp_outq_uncork(struct sctp_outq *q)
 {
-       int error = 0;
        if (q->cork)
                q->cork = 0;
-       error = sctp_outq_flush(q, 0);
-       return error;
+
+       return sctp_outq_flush(q, 0);
 }
 
 
@@ -1700,10 +1693,8 @@ static void sctp_check_transmitted(struct sctp_outq *q,
                 * address.
                 */
                if (!transport->flight_size) {
-                       if (timer_pending(&transport->T3_rtx_timer) &&
-                           del_timer(&transport->T3_rtx_timer)) {
+                       if (del_timer(&transport->T3_rtx_timer))
                                sctp_transport_put(transport);
-                       }
                } else if (restart_timer) {
                        if (!mod_timer(&transport->T3_rtx_timer,
                                       jiffies + transport->rto))