X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=crypto%2Falgif_hash.c;h=ef5356cd280a54c086e4f8ff964245e38748a391;hb=ea8bdfcff17599e5d80f93e2ae194fbbab7f8d5e;hp=62122a1a2f7a6416f1105ff88dae672ccac8a5dd;hpb=1cc26bada9f6807814806db2f0d78792eecdac71;p=deliverable%2Flinux.git diff --git a/crypto/algif_hash.c b/crypto/algif_hash.c index 62122a1a2f7a..ef5356cd280a 100644 --- a/crypto/algif_hash.c +++ b/crypto/algif_hash.c @@ -68,8 +68,10 @@ static int hash_sendmsg(struct kiocb *unused, struct socket *sock, int newlen; newlen = af_alg_make_sg(&ctx->sgl, from, len, 0); - if (newlen < 0) + if (newlen < 0) { + err = copied ? 0 : newlen; goto unlock; + } ahash_request_set_crypt(&ctx->req, ctx->sgl.sg, NULL, newlen);