From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Ricardo Leitner Subject: Re: [PATCH net] sctp: remove the left unnecessary check for chunk in sctp_renege_events Date: Fri, 16 Feb 2018 08:19:22 -0200 Message-ID: <20180216101922.GB4718@localhost.localdomain> References: <0e61bb1ebe6aad2c06f426fec30f69a80d127ad8.1518772713.git.lucien.xin@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: network dev , linux-sctp@vger.kernel.org, davem@davemloft.net, Neil Horman , Dan Carpenter To: Xin Long Return-path: Received: from mail-qk0-f193.google.com ([209.85.220.193]:38958 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933129AbeBPKT2 (ORCPT ); Fri, 16 Feb 2018 05:19:28 -0500 Content-Disposition: inline In-Reply-To: <0e61bb1ebe6aad2c06f426fec30f69a80d127ad8.1518772713.git.lucien.xin@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: On Fri, Feb 16, 2018 at 05:18:33PM +0800, Xin Long wrote: > Commit fb23403536ea ("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: fb23403536ea ("sctp: remove the useless check in sctp_renege_events") > Reported-by: Dan Carpenter > Signed-off-by: Xin Long Acked-by: Marcelo Ricardo Leitner > --- > net/sctp/stream_interleave.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/net/sctp/stream_interleave.c b/net/sctp/stream_interleave.c > index 65ac03b..d3764c1 100644 > --- a/net/sctp/stream_interleave.c > +++ b/net/sctp/stream_interleave.c > @@ -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); > } > -- > 2.1.0 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-sctp" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >