Thread (4 messages) 4 messages, 3 authors, 2016-02-17

Re: [PATCH] af_unix: Don't set err in unix_stream_read_generic unless there was an error

flat view

From: David Miller <davem@davemloft.net>
Date: 2016-02-17 01:07:12
Also in: lkml, stable

Possibly related (same subject, not in this thread)

From: Ben Hutchings <redacted>
Date: Wed, 17 Feb 2016 00:24:51 +0000
I agree that 'if (err) goto cleanup;' is widely used and is generally
understandable (though more creative uses of goto are often not).

My objection was to 'err = -EFOO; if (cond) goto cleanup;'.  That is
definitely not clear and it hides mistakes like this.
I don't see any difference whatsoever.

Part of the convention of the cleanup blob at the end of the
function is that error propagate to it's return statement via
a variable.

If this code wanted to handle that in more than one way, it is
the problem of this function, not of the convention itself.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help