Commit 3e3251b3 authored by Daniel Borkmann's avatar Daniel Borkmann Committed by David S. Miller

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: default avatarDaniel Borkmann <dborkman@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ae884082
...@@ -714,8 +714,7 @@ struct sctp_packet { ...@@ -714,8 +714,7 @@ struct sctp_packet {
has_sack:1, /* This packet contains a SACK chunk. */ has_sack:1, /* This packet contains a SACK chunk. */
has_auth:1, /* This packet contains an AUTH chunk */ has_auth:1, /* This packet contains an AUTH chunk */
has_data:1, /* This packet contains at least 1 DATA chunk */ has_data:1, /* This packet contains at least 1 DATA chunk */
ipfragok:1, /* So let ip fragment this packet */ ipfragok:1; /* So let ip fragment this packet */
malloced:1; /* Is it malloced? */
}; };
struct sctp_packet *sctp_packet_init(struct sctp_packet *, struct sctp_packet *sctp_packet_init(struct sctp_packet *,
......
...@@ -136,7 +136,7 @@ struct sctp_packet *sctp_packet_init(struct sctp_packet *packet, ...@@ -136,7 +136,7 @@ struct sctp_packet *sctp_packet_init(struct sctp_packet *packet,
packet->overhead = overhead; packet->overhead = overhead;
sctp_packet_reset(packet); sctp_packet_reset(packet);
packet->vtag = 0; packet->vtag = 0;
packet->malloced = 0;
return packet; return packet;
} }
...@@ -151,9 +151,6 @@ void sctp_packet_free(struct sctp_packet *packet) ...@@ -151,9 +151,6 @@ void sctp_packet_free(struct sctp_packet *packet)
list_del_init(&chunk->list); list_del_init(&chunk->list);
sctp_chunk_free(chunk); sctp_chunk_free(chunk);
} }
if (packet->malloced)
kfree(packet);
} }
/* This routine tries to append the chunk to the offered packet. If adding /* This routine tries to append the chunk to the offered packet. If adding
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment