netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
To: Xin Long <lucien.xin@gmail.com>
Cc: network dev <netdev@vger.kernel.org>,
	linux-sctp@vger.kernel.org, davem@davemloft.net,
	Neil Horman <nhorman@tuxdriver.com>,
	Dan Carpenter <dan.carpenter@oracle.com>
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	[thread overview]
Message-ID: <20180216101922.GB4718@localhost.localdomain> (raw)
In-Reply-To: <0e61bb1ebe6aad2c06f426fec30f69a80d127ad8.1518772713.git.lucien.xin@gmail.com>

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 <dan.carpenter@oracle.com>
> Signed-off-by: Xin Long <lucien.xin@gmail.com>

Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>

> ---
>  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
> 

  reply	other threads:[~2018-02-16 10:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-16  9:18 [PATCH net] sctp: remove the left unnecessary check for chunk in sctp_renege_events Xin Long
2018-02-16 10:19 ` Marcelo Ricardo Leitner [this message]
2018-02-16 12:26 ` Neil Horman
2018-02-16 21:32 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180216101922.GB4718@localhost.localdomain \
    --to=marcelo.leitner@gmail.com \
    --cc=dan.carpenter@oracle.com \
    --cc=davem@davemloft.net \
    --cc=linux-sctp@vger.kernel.org \
    --cc=lucien.xin@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).