Thread (4 messages) flat view 4 messages, 3 authors, 2011-06-27

Re: [PATCH] Crypto: Don't use err uninitialized in algif_hash.c:hash_sendmsg()

From: David Miller <davem@davemloft.net>
Date: 2011-06-26 23:21:24
Also in: lkml

From: Jesper Juhl <redacted>
Date: Sun, 26 Jun 2011 23:23:06 +0200 (CEST)
If af_alg_make_sg() returns <0 in hash_sendmsg() we'll jump to the
'unlock' label without having set 'err' to anything. At the 'unlock'
label the value of 'err' is tested to determine return value of the
function - not good to base that on a uninitialized variable.

This patch sets 'err' to the return value of hash_sendmsg() before the
'goto' when the value is less than zero, which seems to me to be the
proper thing to do.

Signed-off-by: Jesper Juhl <redacted>
Acked-by: David S. Miller <davem@davemloft.net>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help