Commit 3e3251b3f289528732edab386ddf73ac428359b7
Committed by
David S. Miller
1 parent
ae88408256
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
net: sctp: minor: remove dead code from sctp_packet
struct sctp_packet is currently embedded into sctp_transport or sits on the stack as 'singleton' in sctp_outq_flush(). Therefore, its member 'malloced' is always 0, thus a kfree() is never called. Because of that, we can just remove this code. Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Showing 2 changed files with 2 additions and 6 deletions Side-by-side Diff
include/net/sctp/structs.h
... | ... | @@ -714,8 +714,7 @@ |
714 | 714 | has_sack:1, /* This packet contains a SACK chunk. */ |
715 | 715 | has_auth:1, /* This packet contains an AUTH chunk */ |
716 | 716 | has_data:1, /* This packet contains at least 1 DATA chunk */ |
717 | - ipfragok:1, /* So let ip fragment this packet */ | |
718 | - malloced:1; /* Is it malloced? */ | |
717 | + ipfragok:1; /* So let ip fragment this packet */ | |
719 | 718 | }; |
720 | 719 | |
721 | 720 | struct sctp_packet *sctp_packet_init(struct sctp_packet *, |
net/sctp/output.c
... | ... | @@ -136,7 +136,7 @@ |
136 | 136 | packet->overhead = overhead; |
137 | 137 | sctp_packet_reset(packet); |
138 | 138 | packet->vtag = 0; |
139 | - packet->malloced = 0; | |
139 | + | |
140 | 140 | return packet; |
141 | 141 | } |
142 | 142 | |
... | ... | @@ -151,9 +151,6 @@ |
151 | 151 | list_del_init(&chunk->list); |
152 | 152 | sctp_chunk_free(chunk); |
153 | 153 | } |
154 | - | |
155 | - if (packet->malloced) | |
156 | - kfree(packet); | |
157 | 154 | } |
158 | 155 | |
159 | 156 | /* This routine tries to append the chunk to the offered packet. If adding |