[PATCH 07/39] wimax: generic WiMAX device management (registration, deregistration, etc)

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

 



Inaky Perez-Gonzalez wrote:
> On Thursday 27 November 2008, Patrick McHardy wrote:
>>>
>>> +	result = nla_put_u64(reply_skb, WIMAX_GNL_RESULT_CODE, (u64) code_s64);
>>> +	if (result < 0)
>>> +		dev_err(dev, "Error putting attribute: %d\n", result);
>> This is not how netlink protocols should treat errors.
>> It should return -ENOSPC (everywhere else also of course).
> 
> Other than the fact that this function is gone after Johannes comments
> (so for everywhere else), wouldn't returning the -EMSGSIZE nla_put_*() 
> returns enough?
> 
> I changed all of them to be something like:
> 
> result = nla_put*();
> if (result < 0)
> 	goto error path /* release skb/msg, return result */

That looks fine.


[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