Skip to content

Commit

Permalink
net: sctp: minor: remove dead code from sctp_packet
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Daniel Borkmann authored and David S. Miller committed Apr 22, 2013
1 parent ae88408 commit 3e3251b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
3 changes: 1 addition & 2 deletions include/net/sctp/structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -714,8 +714,7 @@ struct sctp_packet {
has_sack:1, /* This packet contains a SACK chunk. */
has_auth:1, /* This packet contains an AUTH chunk */
has_data:1, /* This packet contains at least 1 DATA chunk */
ipfragok:1, /* So let ip fragment this packet */
malloced:1; /* Is it malloced? */
ipfragok:1; /* So let ip fragment this packet */
};

struct sctp_packet *sctp_packet_init(struct sctp_packet *,
Expand Down
5 changes: 1 addition & 4 deletions net/sctp/output.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ struct sctp_packet *sctp_packet_init(struct sctp_packet *packet,
packet->overhead = overhead;
sctp_packet_reset(packet);
packet->vtag = 0;
packet->malloced = 0;

return packet;
}

Expand All @@ -151,9 +151,6 @@ void sctp_packet_free(struct sctp_packet *packet)
list_del_init(&chunk->list);
sctp_chunk_free(chunk);
}

if (packet->malloced)
kfree(packet);
}

/* This routine tries to append the chunk to the offered packet. If adding
Expand Down

0 comments on commit 3e3251b

Please sign in to comment.