lkml.org 
[lkml]   [2019]   [Dec]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH v2] ppp: Remove redundant BUG_ON() check in ppp_pernet
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>

\
 
 \ /
  Last update: 2019-12-27 13:06    [W:0.026 / U:3.532 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site