[PATCH 07/29] wimax: basic API: kernel/user messaging, rfkill and reset

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Monday 08 December 2008, Johannes Berg wrote:
> On Mon, 2008-12-08 at 11:09 -0800, Inaky Perez-Gonzalez wrote:
 >
> > +struct sk_buff *wimax_pipe_msg_alloc(struct wimax_dev *wimax_dev,
> > +				     const void *msg, size_t size,
> > +				     gfp_t gfp_flags)
...
> > +	might_sleep();
> > +	d_fnstart(3, NULL, "(skb %p info %p)\n", skb, info);
> > +	result = -EPERM;
> > +	if (security_netlink_recv(skb, CAP_NET_ADMIN))
> > +		goto error_perm;
>
> perms check?

Ouch, sorry, right; wonder how I missed this one.

>
> > +	result = -ENODEV;
> > +	wimax_dev = wimax_dev_get_by_genl_info(info);
> > +	if (wimax_dev == NULL)
> > +		goto error_no_wimax_dev;
> >
> >
> > +	result = wimax_dev->op_msg_from_user(wimax_dev, msg_buf, msg_len,
> > info); +error_noop:
> > +error_not_ready:
> > +	mutex_unlock(&wimax_dev->mutex);
> > +error_no_data:
> > +	dev_put(wimax_dev->net_dev);
> > +error_no_wimax_dev:
> > +error_perm:
> > +	d_fnend(3, NULL, "(skb %p info %p) = %d\n", skb, info, result);
> > +	return result;
>
> Do you really need all the fnstart/fnend debugging everywhere? Isn't
> this easily covered by ftrace nowadays? If you remove that you can very
> much simplify the code by using "return -ESOMETHING" instead of jumping
> to a label in many of these functions.

ftrace: ack -- just let it stabilize a couple of versions (/me thinks e1000
fiasco), then I'll happily get rid of them.

-- 
Inaky


[Index of Archives]     [Linux Kernel]     [Linux Wireless]     [Linux Bluetooth]     [Linux Netdev]     [Linux Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux