All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vlad Yasevich <vyasevich@gmail.com>
To: Wang Weidong <wangweidong1@huawei.com>,
	Neil Horman <nhorman@tuxdriver.com>,
	David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, linux-sctp@vger.kernel.org
Subject: Re: [PATCH net-next] sctp: remove redundant null check on asoc
Date: Wed, 11 Dec 2013 14:38:58 +0000	[thread overview]
Message-ID: <52A87902.8070900@gmail.com> (raw)
In-Reply-To: <52A82566.1050601@huawei.com>

On 12/11/2013 03:42 AM, Wang Weidong wrote:
> In sctp_err_lookup, goto out while the asoc is not NULL, so remove the
> check NULL. Also, in sctp_err_finish which called by sctp_v4_err and
> sctp_v6_err, they pass asoc to sctp_err_finish while the asoc is not
> NULL, so remove the check.
> 
> Signed-off-by: Wang Weidong <wangweidong1@huawei.com>


Acked-by: Vlad Yasevich <vyasevich@gmail.com>

Thanks
-vlad

> ---
>  net/sctp/input.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/net/sctp/input.c b/net/sctp/input.c
> index 6603853..2a192a7 100644
> --- a/net/sctp/input.c
> +++ b/net/sctp/input.c
> @@ -536,8 +536,7 @@ struct sock *sctp_err_lookup(struct net *net, int family, struct sk_buff *skb,
>  	return sk;
>  
>  out:
> -	if (asoc)
> -		sctp_association_put(asoc);
> +	sctp_association_put(asoc);
>  	return NULL;
>  }
>  
> @@ -545,8 +544,7 @@ out:
>  void sctp_err_finish(struct sock *sk, struct sctp_association *asoc)
>  {
>  	sctp_bh_unlock_sock(sk);
> -	if (asoc)
> -		sctp_association_put(asoc);
> +	sctp_association_put(asoc);
>  }
>  
>  /*
> 


WARNING: multiple messages have this Message-ID (diff)
From: Vlad Yasevich <vyasevich@gmail.com>
To: Wang Weidong <wangweidong1@huawei.com>,
	Neil Horman <nhorman@tuxdriver.com>,
	David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, linux-sctp@vger.kernel.org
Subject: Re: [PATCH net-next] sctp: remove redundant null check on asoc
Date: Wed, 11 Dec 2013 09:38:58 -0500	[thread overview]
Message-ID: <52A87902.8070900@gmail.com> (raw)
In-Reply-To: <52A82566.1050601@huawei.com>

On 12/11/2013 03:42 AM, Wang Weidong wrote:
> In sctp_err_lookup, goto out while the asoc is not NULL, so remove the
> check NULL. Also, in sctp_err_finish which called by sctp_v4_err and
> sctp_v6_err, they pass asoc to sctp_err_finish while the asoc is not
> NULL, so remove the check.
> 
> Signed-off-by: Wang Weidong <wangweidong1@huawei.com>


Acked-by: Vlad Yasevich <vyasevich@gmail.com>

Thanks
-vlad

> ---
>  net/sctp/input.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/net/sctp/input.c b/net/sctp/input.c
> index 6603853..2a192a7 100644
> --- a/net/sctp/input.c
> +++ b/net/sctp/input.c
> @@ -536,8 +536,7 @@ struct sock *sctp_err_lookup(struct net *net, int family, struct sk_buff *skb,
>  	return sk;
>  
>  out:
> -	if (asoc)
> -		sctp_association_put(asoc);
> +	sctp_association_put(asoc);
>  	return NULL;
>  }
>  
> @@ -545,8 +544,7 @@ out:
>  void sctp_err_finish(struct sock *sk, struct sctp_association *asoc)
>  {
>  	sctp_bh_unlock_sock(sk);
> -	if (asoc)
> -		sctp_association_put(asoc);
> +	sctp_association_put(asoc);
>  }
>  
>  /*
> 

  parent reply	other threads:[~2013-12-11 14:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-11  8:42 [PATCH net-next] sctp: remove redundant null check on asoc Wang Weidong
2013-12-11  8:42 ` Wang Weidong
2013-12-11 12:09 ` Neil Horman
2013-12-11 12:09   ` Neil Horman
2013-12-11 14:38 ` Vlad Yasevich [this message]
2013-12-11 14:38   ` Vlad Yasevich
2013-12-11 20:39 ` David Miller
2013-12-11 20:39   ` 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=52A87902.8070900@gmail.com \
    --to=vyasevich@gmail.com \
    --cc=davem@davemloft.net \
    --cc=linux-sctp@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    --cc=wangweidong1@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.