All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guillaume Nault <gnault@redhat.com>
To: Xu Wang <vulab@iscas.ac.cn>
Cc: paulus@samba.org, davem@davemloft.net, linux-ppp@vger.kernel.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] ppp: Remove redundant BUG_ON() check in ppp_pernet
Date: Fri, 27 Dec 2019 12:05:36 +0000	[thread overview]
Message-ID: <20191227120536.GA32264@linux-2.home> (raw)
In-Reply-To: <1577243224-1923-1-git-send-email-vulab@iscas.ac.cn>

On Wed, Dec 25, 2019 at 03:07:04AM +0000, Xu Wang wrote:
> Passing NULL to ppp_pernet causes a crash via BUG_ON.
> Dereferencing net in net_generic() also has the same effect.
> This patch removes the redundant BUG_ON check on the same parameter.
> 
> Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
> ---
>  drivers/net/ppp/ppp_generic.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c
> index 3bf8a8b..22cc2cb 100644
> --- a/drivers/net/ppp/ppp_generic.c
> +++ b/drivers/net/ppp/ppp_generic.c
> @@ -296,8 +296,6 @@ static struct class *ppp_class;
>  /* per net-namespace data */
>  static inline struct ppp_net *ppp_pernet(struct net *net)
>  {
> -	BUG_ON(!net);
> -
>  	return net_generic(net, ppp_net_id);
>  }
Acked-by: Guillaume Nault <gnault@redhat.com>

WARNING: multiple messages have this Message-ID (diff)
From: Guillaume Nault <gnault@redhat.com>
To: Xu Wang <vulab@iscas.ac.cn>
Cc: paulus@samba.org, davem@davemloft.net, linux-ppp@vger.kernel.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] ppp: Remove redundant BUG_ON() check in ppp_pernet
Date: Fri, 27 Dec 2019 13:05:36 +0100	[thread overview]
Message-ID: <20191227120536.GA32264@linux-2.home> (raw)
In-Reply-To: <1577243224-1923-1-git-send-email-vulab@iscas.ac.cn>

On Wed, Dec 25, 2019 at 03:07:04AM +0000, Xu Wang wrote:
> Passing NULL to ppp_pernet causes a crash via BUG_ON.
> Dereferencing net in net_generic() also has the same effect.
> This patch removes the redundant BUG_ON check on the same parameter.
> 
> Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
> ---
>  drivers/net/ppp/ppp_generic.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c
> index 3bf8a8b..22cc2cb 100644
> --- a/drivers/net/ppp/ppp_generic.c
> +++ b/drivers/net/ppp/ppp_generic.c
> @@ -296,8 +296,6 @@ static struct class *ppp_class;
>  /* per net-namespace data */
>  static inline struct ppp_net *ppp_pernet(struct net *net)
>  {
> -	BUG_ON(!net);
> -
>  	return net_generic(net, ppp_net_id);
>  }
Acked-by: Guillaume Nault <gnault@redhat.com>


  reply	other threads:[~2019-12-27 12:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-25  3:07 [PATCH v2] ppp: Remove redundant BUG_ON() check in ppp_pernet Xu Wang
2019-12-27 12:05 ` Guillaume Nault [this message]
2019-12-27 12:05   ` Guillaume Nault

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=20191227120536.GA32264@linux-2.home \
    --to=gnault@redhat.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-ppp@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=paulus@samba.org \
    --cc=vulab@iscas.ac.cn \
    /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.