crypto: algif_hash - Handle initial af_alg_make_sg error correctly
authorHerbert Xu <herbert@gondor.apana.org.au>
Mon, 27 Jun 2011 07:45:19 +0000 (15:45 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 29 Jun 2011 23:44:06 +0000 (07:44 +0800)
When the first call to af_alg_make_sg fails, we may return garbage
instead of the real error.  This patch fixes it by setting the error
if "copied" is zero.

Based on a patch by Jesper Juhl.

Reported-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

No differences found