Skip to content

Commit 165a4c3

Browse files
Daniel Borkmanndavem330
authored andcommitted
net: sctp: sctp_outq: remove 'malloced' from its struct
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]>
1 parent ee16371 commit 165a4c3

File tree

2 files changed

+0
-9
lines changed

2 files changed

+0
-9
lines changed

include/net/sctp/structs.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,9 +1059,6 @@ struct sctp_outq {
10591059

10601060
/* Is this structure empty? */
10611061
char empty;
1062-
1063-
/* Are we kfree()able? */
1064-
char malloced;
10651062
};
10661063

10671064
void sctp_outq_init(struct sctp_association *, struct sctp_outq *);

net/sctp/outqueue.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,6 @@ void sctp_outq_init(struct sctp_association *asoc, struct sctp_outq *q)
217217
q->outstanding_bytes = 0;
218218
q->empty = 1;
219219
q->cork = 0;
220-
221-
q->malloced = 0;
222220
q->out_qlen = 0;
223221
}
224222

@@ -295,10 +293,6 @@ void sctp_outq_free(struct sctp_outq *q)
295293
{
296294
/* Throw away leftover chunks. */
297295
__sctp_outq_teardown(q);
298-
299-
/* If we were kmalloc()'d, free the memory. */
300-
if (q->malloced)
301-
kfree(q);
302296
}
303297

304298
/* Put a new chunk in an sctp_outq. */

0 commit comments

Comments
 (0)