Skip to content

Commit

Permalink
net: sctp: sctp_bind_addr: remove dead code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Daniel Borkmann authored and David S. Miller committed Apr 17, 2013
1 parent 8fa5df6 commit 50181c0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
2 changes: 0 additions & 2 deletions include/net/sctp/structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1093,8 +1093,6 @@ struct sctp_bind_addr {
* peer(s) in INIT and INIT ACK chunks.
*/
struct list_head address_list;

int malloced; /* Are we kfree()able? */
};

void sctp_bind_addr_init(struct sctp_bind_addr *, __u16 port);
Expand Down
7 changes: 0 additions & 7 deletions net/sctp/bind_addr.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,6 @@ int sctp_bind_addr_dup(struct sctp_bind_addr *dest,
*/
void sctp_bind_addr_init(struct sctp_bind_addr *bp, __u16 port)
{
bp->malloced = 0;

INIT_LIST_HEAD(&bp->address_list);
bp->port = port;
}
Expand All @@ -155,11 +153,6 @@ void sctp_bind_addr_free(struct sctp_bind_addr *bp)
{
/* Empty the bind address list. */
sctp_bind_addr_clean(bp);

if (bp->malloced) {
kfree(bp);
SCTP_DBG_OBJCNT_DEC(bind_addr);
}
}

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

0 comments on commit 50181c0

Please sign in to comment.