perf build-id: Fix coding style, replace 8 spaces by tabs
[linux-2.6-microblaze.git] / crypto / algif_hash.c
index 50f7b22..1d017ec 100644 (file)
@@ -102,11 +102,12 @@ static int hash_sendmsg(struct socket *sock, struct msghdr *msg,
                err = crypto_wait_req(crypto_ahash_update(&ctx->req),
                                      &ctx->wait);
                af_alg_free_sg(&ctx->sgl);
-               if (err)
+               if (err) {
+                       iov_iter_revert(&msg->msg_iter, len);
                        goto unlock;
+               }
 
                copied += len;
-               iov_iter_advance(&msg->msg_iter, len);
        }
 
        err = 0;