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

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

 



From: Ben Hutchings <ben@xxxxxxxxxxxxxxx>
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.
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]