Thread (95 messages) 95 messages, 9 authors, 2008-12-04

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

From: Patrick McHardy <hidden>
Date: 2008-12-04 13:02:49

Inaky Perez-Gonzalez wrote:
On Thursday 27 November 2008, Patrick McHardy wrote:
quoted
quoted
+	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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help