Skip to content

Commit 50181c0

Browse files
Daniel Borkmanndavem330
authored andcommitted
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 <[email protected]> Acked-by: Neil Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 8fa5df6 commit 50181c0

File tree

2 files changed

+0
-9
lines changed

2 files changed

+0
-9
lines changed

include/net/sctp/structs.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,8 +1093,6 @@ struct sctp_bind_addr {
10931093
* peer(s) in INIT and INIT ACK chunks.
10941094
*/
10951095
struct list_head address_list;
1096-
1097-
int malloced; /* Are we kfree()able? */
10981096
};
10991097

11001098
void sctp_bind_addr_init(struct sctp_bind_addr *, __u16 port);

net/sctp/bind_addr.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,6 @@ int sctp_bind_addr_dup(struct sctp_bind_addr *dest,
131131
*/
132132
void sctp_bind_addr_init(struct sctp_bind_addr *bp, __u16 port)
133133
{
134-
bp->malloced = 0;
135-
136134
INIT_LIST_HEAD(&bp->address_list);
137135
bp->port = port;
138136
}
@@ -155,11 +153,6 @@ void sctp_bind_addr_free(struct sctp_bind_addr *bp)
155153
{
156154
/* Empty the bind address list. */
157155
sctp_bind_addr_clean(bp);
158-
159-
if (bp->malloced) {
160-
kfree(bp);
161-
SCTP_DBG_OBJCNT_DEC(bind_addr);
162-
}
163156
}
164157

165158
/* Add an address to the bind address list in the SCTP_bind_addr structure. */

0 commit comments

Comments
 (0)