Skip to content

Commit

Permalink
net: sctp: sctp_outq: remove 'malloced' from its struct
Browse files Browse the repository at this point in the history
sctp_outq is embedded into sctp_association, and thus never
kmalloced in any way. Also, malloced is always 0, thus kfree()
is never called. Therefore, remove that dead piece of code.

Signed-off-by: Daniel Borkmann <[email protected]>
Acked-by: Neil Horman <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Daniel Borkmann authored and davem330 committed Apr 17, 2013
1 parent ee16371 commit 165a4c3
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
3 changes: 0 additions & 3 deletions include/net/sctp/structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1059,9 +1059,6 @@ struct sctp_outq {

/* Is this structure empty? */
char empty;

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

void sctp_outq_init(struct sctp_association *, struct sctp_outq *);
Expand Down
6 changes: 0 additions & 6 deletions net/sctp/outqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,6 @@ void sctp_outq_init(struct sctp_association *asoc, struct sctp_outq *q)
q->outstanding_bytes = 0;
q->empty = 1;
q->cork = 0;

q->malloced = 0;
q->out_qlen = 0;
}

Expand Down Expand Up @@ -295,10 +293,6 @@ void sctp_outq_free(struct sctp_outq *q)
{
/* Throw away leftover chunks. */
__sctp_outq_teardown(q);

/* If we were kmalloc()'d, free the memory. */
if (q->malloced)
kfree(q);
}

/* Put a new chunk in an sctp_outq. */
Expand Down

0 comments on commit 165a4c3

Please sign in to comment.