Re: KEYS: trusted: Use common error handling code in trusted_update()

2017-11-11 Thread SF Markus Elfring
> Safe means that cleanup code should appear once in a cascade at the end > of the function, to minimize the chance that anything will be overlooked. I find that the control flow of this function implementation does not fit to the mentioned ideal so far. > Moving the ret assignments to the end o

Re: [PATCH 1/2] KEYS: trusted: Use common error handling code in trusted_update()

2017-11-10 Thread Julia Lawall
On Fri, 10 Nov 2017, SF Markus Elfring wrote: > From: Markus Elfring > Date: Fri, 10 Nov 2017 20:50:15 +0100 > > Adjust jump targets so that a bit of exception handling can be better > reused at the end of this function. Unless there is a strong motivation for doing otherwise, the goal should

[PATCH 1/2] KEYS: trusted: Use common error handling code in trusted_update()

2017-11-10 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 10 Nov 2017 20:50:15 +0100 Adjust jump targets so that a bit of exception handling can be better reused at the end of this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- security/keys/trusted.c | 44 +++