net: sctp: sctp_ulpq: remove 'malloced' struct member
authorDaniel Borkmann <dborkman@redhat.com>
Tue, 16 Apr 2013 11:07:17 +0000 (11:07 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 17 Apr 2013 18:13:02 +0000 (14:13 -0400)
The structure sctp_ulpq is embedded into sctp_association and never
separately allocated, also ulpq->malloced is always 0, so that
kfree() is never called. Therefore, remove this 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/ulpqueue.h
net/sctp/ulpqueue.c

index ff1b8ba73ab10b5678562919e6c43db0f768821b..00e50ba3f24b71a2db54d810ee9889f674444a7b 100644 (file)
@@ -49,7 +49,6 @@
 
 /* A structure to carry information to the ULP (e.g. Sockets API) */
 struct sctp_ulpq {
-       char malloced;
        char pd_mode;
        struct sctp_association *asoc;
        struct sk_buff_head reasm;
index 0fd5b3d2df03158d17f0d356825209e571e419d7..04e3d470f877e51cc3238a3939595c1d90b83b37 100644 (file)
@@ -68,7 +68,6 @@ struct sctp_ulpq *sctp_ulpq_init(struct sctp_ulpq *ulpq,
        skb_queue_head_init(&ulpq->reasm);
        skb_queue_head_init(&ulpq->lobby);
        ulpq->pd_mode  = 0;
-       ulpq->malloced = 0;
 
        return ulpq;
 }
@@ -96,8 +95,6 @@ void sctp_ulpq_flush(struct sctp_ulpq *ulpq)
 void sctp_ulpq_free(struct sctp_ulpq *ulpq)
 {
        sctp_ulpq_flush(ulpq);
-       if (ulpq->malloced)
-               kfree(ulpq);
 }
 
 /* Process an incoming DATA chunk.  */