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

Patrick McHardy kaber at trash.net
Thu Dec 4 06:02:46 MST 2008


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.



More information about the wimax mailing list