Skip to content

Commit

Permalink
sctp: remove the useless check in sctp_renege_events
Browse files Browse the repository at this point in the history
Remove the 'if (chunk)' check in sctp_renege_events for idata process,
as all renege commands are generated in sctp_eat_data and it can't be
NULL.

The same thing we already did for common data in sctp_ulpq_renege.

Fixes: 94014e8 ("sctp: implement renege_events for sctp_stream_interleave")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Xin Long authored and David S. Miller committed Feb 12, 2018
1 parent 947820b commit fb23403
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions net/sctp/stream_interleave.c
Original file line number Diff line number Diff line change
Expand Up @@ -954,12 +954,8 @@ static void sctp_renege_events(struct sctp_ulpq *ulpq, struct sctp_chunk *chunk,
__u32 freed = 0;
__u16 needed;

if (chunk) {
needed = ntohs(chunk->chunk_hdr->length);
needed -= sizeof(struct sctp_idata_chunk);
} else {
needed = SCTP_DEFAULT_MAXWINDOW;
}
needed = ntohs(chunk->chunk_hdr->length) -
sizeof(struct sctp_idata_chunk);

if (skb_queue_empty(&asoc->base.sk->sk_receive_queue)) {
freed = sctp_ulpq_renege_list(ulpq, &ulpq->lobby, needed);
Expand Down

0 comments on commit fb23403

Please sign in to comment.