Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: sctp: sctp_ulpq: remove 'malloced' struct member

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>

authored by

Daniel Borkmann and committed by
David S. Miller
c1db7a26 50181c07

-4
-1
include/net/sctp/ulpqueue.h
··· 49 49 50 50 /* A structure to carry information to the ULP (e.g. Sockets API) */ 51 51 struct sctp_ulpq { 52 - char malloced; 53 52 char pd_mode; 54 53 struct sctp_association *asoc; 55 54 struct sk_buff_head reasm;
-3
net/sctp/ulpqueue.c
··· 68 68 skb_queue_head_init(&ulpq->reasm); 69 69 skb_queue_head_init(&ulpq->lobby); 70 70 ulpq->pd_mode = 0; 71 - ulpq->malloced = 0; 72 71 73 72 return ulpq; 74 73 } ··· 95 96 void sctp_ulpq_free(struct sctp_ulpq *ulpq) 96 97 { 97 98 sctp_ulpq_flush(ulpq); 98 - if (ulpq->malloced) 99 - kfree(ulpq); 100 99 } 101 100 102 101 /* Process an incoming DATA chunk. */