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.
- [RFC PATCH 2/6] ppp: don't hold ppp_mutex before calling... Guillaume Nault
- [RFC PATCH 5/6] ppp: define reusable device creation fun... Guillaume Nault
- Re: [RFC PATCH 5/6] ppp: define reusable device cre... Stephen Hemminger
- Re: [RFC PATCH 5/6] ppp: define reusable device... Guillaume Nault
- Re: [RFC PATCH 5/6] ppp: define reusable de... Stephen Hemminger
- [RFC PATCH 1/6] ppp: simplify usage of ppp_create_interf... Guillaume Nault
- [RFC PATCH 3/6] ppp: don't lock ppp_mutex while handling... Guillaume Nault
- [RFC PATCH 4/6] ppp: invert lock ordering between ppp_mu... Guillaume Nault
- [RFC PATCH 6/6] ppp: add rtnetlink device creation suppo... Guillaume Nault
- Re: [RFC PATCH 6/6] ppp: add rtnetlink device creat... walter harms
- Re: [RFC PATCH 6/6] ppp: add rtnetlink device c... Guillaume Nault
- Re: [RFC PATCH 6/6] ppp: add rtnetlink devi... walter harms
- Re: [RFC PATCH 6/6] ppp: add rtnetlink ... Guillaume Nault
- Re: [RFC PATCH 0/6] ppp: add rtnetlink support Stephen Hemminger
- Re: [RFC PATCH 0/6] ppp: add rtnetlink support Guillaume Nault