lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <87y4k8cast.fsf@x220.int.ebiederm.org>
Date:	Thu, 28 May 2015 22:38:58 -0500
From:	ebiederm@...ssion.com (Eric W. Biederman)
To:	Nicholas Krause <xerofoify@...il.com>
Cc:	davem@...emloft.net, nicolas.dichtel@...nd.com,
	viro@...iv.linux.org.uk, edumazet@...gle.com,
	yongjun_wei@...ndmicro.com.cn, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] namespace: Remove no longer needed goto label in the function, ops_init

Nicholas Krause <xerofoify@...il.com> writes:

> This removes the no longer needed goto label, cleanup in the
> function ops_init due to kfree being NULL pointer safe and
> therefore no need to avoid calling it the call to kzalloc
> fails inside this particular function.

Your proposed change pessimizes the error path without a description of
why that would be a benefit.

Further the subject on this patch is incorrect.  You don't remove any
gotos.

So I don't like this change as it.  The description is wrong
and the change provides little to no real world benefit.

Eric


> Signed-off-by: Nicholas Krause <xerofoify@...il.com>
> ---
>  net/core/net_namespace.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
> index 572af00..e8b5568 100644
> --- a/net/core/net_namespace.c
> +++ b/net/core/net_namespace.c
> @@ -102,7 +102,7 @@ static int ops_init(const struct pernet_operations *ops, struct net *net)
>  
>  		err = net_assign_generic(net, *ops->id, data);
>  		if (err)
> -			goto cleanup;
> +			goto out;
>  	}
>  	err = 0;
>  	if (ops->init)
> @@ -110,10 +110,8 @@ static int ops_init(const struct pernet_operations *ops, struct net *net)
>  	if (!err)
>  		return 0;
>  
> -cleanup:
> -	kfree(data);
> -
>  out:
> +	kfree(data);
>  	return err;
>  }
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ