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

net: sctp: sctp_bind_addr: remove dead code

The sctp_bind_addr structure has a 'malloced' member that is
always set to 0, thus in sctp_bind_addr_free() the kfree()
part can never be called. This part is embedded into
sctp_ep_common anyway and never alloced.

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
50181c07 8fa5df6d

-9
-2
include/net/sctp/structs.h
··· 1093 1093 * peer(s) in INIT and INIT ACK chunks. 1094 1094 */ 1095 1095 struct list_head address_list; 1096 - 1097 - int malloced; /* Are we kfree()able? */ 1098 1096 }; 1099 1097 1100 1098 void sctp_bind_addr_init(struct sctp_bind_addr *, __u16 port);
-7
net/sctp/bind_addr.c
··· 131 131 */ 132 132 void sctp_bind_addr_init(struct sctp_bind_addr *bp, __u16 port) 133 133 { 134 - bp->malloced = 0; 135 - 136 134 INIT_LIST_HEAD(&bp->address_list); 137 135 bp->port = port; 138 136 } ··· 153 155 { 154 156 /* Empty the bind address list. */ 155 157 sctp_bind_addr_clean(bp); 156 - 157 - if (bp->malloced) { 158 - kfree(bp); 159 - SCTP_DBG_OBJCNT_DEC(bind_addr); 160 - } 161 158 } 162 159 163 160 /* Add an address to the bind address list in the SCTP_bind_addr structure. */