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>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 6 Apr 2016 10:21:07 +0200
From:	Guillaume Nault <g.nault@...halink.fr>
To:	walter harms <wharms@....de>
Cc:	netdev@...r.kernel.org, linux-ppp@...r.kernel.org,
	Paul Mackerras <paulus@...ba.org>,
	David Miller <davem@...emloft.net>
Subject: Re: [RFC PATCH 6/6] ppp: add rtnetlink device creation support

On Wed, Apr 06, 2016 at 10:02:56AM +0200, walter harms wrote:
> 
> 
> Am 05.04.2016 23:22, schrieb Guillaume Nault:
> > On Tue, Apr 05, 2016 at 07:18:14PM +0200, walter harms wrote:
> >>
> >>
> >> Am 05.04.2016 02:56, schrieb Guillaume Nault:
> >>> @@ -1043,12 +1048,39 @@ static int ppp_dev_configure(struct net *src_net, struct net_device *dev,
> >>>  			     const struct ppp_config *conf)
> >>>  {
> >>>  	struct ppp *ppp = netdev_priv(dev);
> >>> +	struct file *file;
> >>>  	int indx;
> >>> +	int err;
> >>> +
> >>> +	if (conf->fd < 0) {
> >>> +		file = conf->file;
> >>> +		if (!file) {
> >>> +			err = -EBADF;
> >>> +			goto out;
> >>
> >> why not just return -EBADF;
> >>
> >>> +		}
> >>> +	} else {
> >>> +		file = fget(conf->fd);
> >>> +		if (!file) {
> >>> +			err = -EBADF;
> >>> +			goto out;
> >> 	
> >> why not just return -EBADF;
> >>
> > Just because the 'out' label is declared anyway and because this
> > centralises the return point. But I agree returning -EBADF directly
> > could be more readable. I don't have strong opinion.
> 
> in this special case i would go for readable. People tend to miss these
> if
>  if
>   if
> constructs.
> 
Ok, I'll do that in v3.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ