Skip to content

Commit

Permalink
sctp: remove the left unnecessary check for chunk in sctp_renege_events
Browse files Browse the repository at this point in the history
Commit fb23403 ("sctp: remove the useless check in
sctp_renege_events") forgot to remove another check for
chunk in sctp_renege_events.

Dan found this when doing a static check.

This patch is to remove that check, and also to merge
two checks into one 'if statement'.

Fixes: fb23403 ("sctp: remove the useless check in sctp_renege_events")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
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 16, 2018
1 parent a16b8d0 commit 9ab2323
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions net/sctp/stream_interleave.c
Original file line number Diff line number Diff line change
Expand Up @@ -968,9 +968,8 @@ static void sctp_renege_events(struct sctp_ulpq *ulpq, struct sctp_chunk *chunk,
needed);
}

if (chunk && freed >= needed)
if (sctp_ulpevent_idata(ulpq, chunk, gfp) <= 0)
sctp_intl_start_pd(ulpq, gfp);
if (freed >= needed && sctp_ulpevent_idata(ulpq, chunk, gfp) <= 0)
sctp_intl_start_pd(ulpq, gfp);

sk_mem_reclaim(asoc->base.sk);
}
Expand Down

0 comments on commit 9ab2323

Please sign in to comment.