]> git.ipfire.org Git - people/ms/linux.git/commitdiff
net: sctp: sctp_outq: remove 'malloced' from its struct
authorDaniel Borkmann <dborkman@redhat.com>
Tue, 16 Apr 2013 11:07:12 +0000 (11:07 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 17 Apr 2013 18:13:02 +0000 (14:13 -0400)
sctp_outq is embedded into sctp_association, and thus never
kmalloced in any way. Also, malloced is always 0, thus kfree()
is never called. Therefore, remove that dead piece of code.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/sctp/structs.h
net/sctp/outqueue.c

index 125a19c73531c87a39ec93a7eecf3627c37986fc..73fd5de4d4cc249bc82128fdc478b1e94a796fbe 100644 (file)
@@ -1059,9 +1059,6 @@ struct sctp_outq {
 
        /* Is this structure empty?  */
        char empty;
-
-       /* Are we kfree()able? */
-       char malloced;
 };
 
 void sctp_outq_init(struct sctp_association *, struct sctp_outq *);
index 01dca753db16a9b53c57fc4e92fca6d52e55df36..d4c137e1ab856efe740d7a6b2ed973dc6a30c7a9 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.  */