diff --git a/crypto/af_alg.c b/crypto/af_alg.c index 314c52c967e5882a72b26adf821fd92a2bef5a02..c166f424871c86a356b15eff8bdd3b2be6406a87 100644 --- a/crypto/af_alg.c +++ b/crypto/af_alg.c @@ -1155,8 +1155,10 @@ int af_alg_get_rsgl(struct sock *sk, struct msghdr *msg, int flags, /* make one iovec available as scatterlist */ err = af_alg_make_sg(&rsgl->sgl, &msg->msg_iter, seglen); - if (err < 0) + if (err < 0) { + rsgl->sg_num_bytes = 0; return err; + } /* chain the new scatterlist with previous one */ if (areq->last_rsgl)