diff options
| author | Daniel Borkmann <dborkman@redhat.com> | 2013-04-16 07:07:16 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2013-04-17 14:13:02 -0400 |
| commit | 50181c07cbde370986c4925b830ca291a2fc31ab (patch) | |
| tree | 1dcd5c4336ac3ed4c2a2817c4d5cb75c822d6d5f | |
| parent | 8fa5df6d210a09241876b74d156c57d833dd057b (diff) | |
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>
| -rw-r--r-- | include/net/sctp/structs.h | 2 | ||||
| -rw-r--r-- | net/sctp/bind_addr.c | 7 |
2 files changed, 0 insertions, 9 deletions
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index d581af00120b..64d469845f25 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
| @@ -1093,8 +1093,6 @@ struct sctp_bind_addr { | |||
| 1093 | * peer(s) in INIT and INIT ACK chunks. | 1093 | * peer(s) in INIT and INIT ACK chunks. |
| 1094 | */ | 1094 | */ |
| 1095 | struct list_head address_list; | 1095 | struct list_head address_list; |
| 1096 | |||
| 1097 | int malloced; /* Are we kfree()able? */ | ||
| 1098 | }; | 1096 | }; |
| 1099 | 1097 | ||
| 1100 | void sctp_bind_addr_init(struct sctp_bind_addr *, __u16 port); | 1098 | void sctp_bind_addr_init(struct sctp_bind_addr *, __u16 port); |
diff --git a/net/sctp/bind_addr.c b/net/sctp/bind_addr.c index d886b3bf84f5..41145fe31813 100644 --- a/net/sctp/bind_addr.c +++ b/net/sctp/bind_addr.c | |||
| @@ -131,8 +131,6 @@ int sctp_bind_addr_dup(struct sctp_bind_addr *dest, | |||
| 131 | */ | 131 | */ |
| 132 | void sctp_bind_addr_init(struct sctp_bind_addr *bp, __u16 port) | 132 | void sctp_bind_addr_init(struct sctp_bind_addr *bp, __u16 port) |
| 133 | { | 133 | { |
| 134 | bp->malloced = 0; | ||
| 135 | |||
| 136 | INIT_LIST_HEAD(&bp->address_list); | 134 | INIT_LIST_HEAD(&bp->address_list); |
| 137 | bp->port = port; | 135 | bp->port = port; |
| 138 | } | 136 | } |
| @@ -155,11 +153,6 @@ void sctp_bind_addr_free(struct sctp_bind_addr *bp) | |||
| 155 | { | 153 | { |
| 156 | /* Empty the bind address list. */ | 154 | /* Empty the bind address list. */ |
| 157 | sctp_bind_addr_clean(bp); | 155 | sctp_bind_addr_clean(bp); |
| 158 | |||
| 159 | if (bp->malloced) { | ||
| 160 | kfree(bp); | ||
| 161 | SCTP_DBG_OBJCNT_DEC(bind_addr); | ||
| 162 | } | ||
| 163 | } | 156 | } |
| 164 | 157 | ||
| 165 | /* Add an address to the bind address list in the SCTP_bind_addr structure. */ | 158 | /* Add an address to the bind address list in the SCTP_bind_addr structure. */ |
