diff options
-rw-r--r-- | crypto/authenc.c | 5 | ||||
-rw-r--r-- | crypto/cryptd.c | 4 | ||||
-rw-r--r-- | crypto/eseqiv.c | 3 | ||||
-rw-r--r-- | include/crypto/scatterwalk.h | 4 |
4 files changed, 12 insertions, 4 deletions
diff --git a/crypto/authenc.c b/crypto/authenc.c index ed8ac5a6fa5f..4b226768752a 100644 --- a/crypto/authenc.c +++ b/crypto/authenc.c | |||
@@ -217,9 +217,10 @@ static void crypto_authenc_givencrypt_done(struct crypto_async_request *req, | |||
217 | int err) | 217 | int err) |
218 | { | 218 | { |
219 | if (!err) { | 219 | if (!err) { |
220 | struct aead_givcrypt_request *greq = req->data; | 220 | struct aead_request *areq = req->data; |
221 | struct skcipher_givcrypt_request *greq = aead_request_ctx(areq); | ||
221 | 222 | ||
222 | err = crypto_authenc_genicv(&greq->areq, greq->giv, 0); | 223 | err = crypto_authenc_genicv(areq, greq->giv, 0); |
223 | } | 224 | } |
224 | 225 | ||
225 | aead_request_complete(req->data, err); | 226 | aead_request_complete(req->data, err); |
diff --git a/crypto/cryptd.c b/crypto/cryptd.c index 250425263e00..b150de562057 100644 --- a/crypto/cryptd.c +++ b/crypto/cryptd.c | |||
@@ -190,8 +190,10 @@ static struct crypto_instance *cryptd_alloc_instance(struct crypto_alg *alg, | |||
190 | int err; | 190 | int err; |
191 | 191 | ||
192 | inst = kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL); | 192 | inst = kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL); |
193 | if (IS_ERR(inst)) | 193 | if (!inst) { |
194 | inst = ERR_PTR(-ENOMEM); | ||
194 | goto out; | 195 | goto out; |
196 | } | ||
195 | 197 | ||
196 | err = -ENAMETOOLONG; | 198 | err = -ENAMETOOLONG; |
197 | if (snprintf(inst->alg.cra_driver_name, CRYPTO_MAX_ALG_NAME, | 199 | if (snprintf(inst->alg.cra_driver_name, CRYPTO_MAX_ALG_NAME, |
diff --git a/crypto/eseqiv.c b/crypto/eseqiv.c index b14f14e314b6..881d30910434 100644 --- a/crypto/eseqiv.c +++ b/crypto/eseqiv.c | |||
@@ -136,7 +136,8 @@ static int eseqiv_givencrypt(struct skcipher_givcrypt_request *req) | |||
136 | } | 136 | } |
137 | 137 | ||
138 | ablkcipher_request_set_crypt(subreq, reqctx->src, dst, | 138 | ablkcipher_request_set_crypt(subreq, reqctx->src, dst, |
139 | req->creq.nbytes, req->creq.info); | 139 | req->creq.nbytes + ivsize, |
140 | req->creq.info); | ||
140 | 141 | ||
141 | memcpy(req->creq.info, ctx->salt, ivsize); | 142 | memcpy(req->creq.info, ctx->salt, ivsize); |
142 | 143 | ||
diff --git a/include/crypto/scatterwalk.h b/include/crypto/scatterwalk.h index 224658b8d806..833d208c25d6 100644 --- a/include/crypto/scatterwalk.h +++ b/include/crypto/scatterwalk.h | |||
@@ -57,10 +57,14 @@ static inline void scatterwalk_sg_chain(struct scatterlist *sg1, int num, | |||
57 | struct scatterlist *sg2) | 57 | struct scatterlist *sg2) |
58 | { | 58 | { |
59 | sg_set_page(&sg1[num - 1], (void *)sg2, 0, 0); | 59 | sg_set_page(&sg1[num - 1], (void *)sg2, 0, 0); |
60 | sg1[num - 1].page_link &= ~0x02; | ||
60 | } | 61 | } |
61 | 62 | ||
62 | static inline struct scatterlist *scatterwalk_sg_next(struct scatterlist *sg) | 63 | static inline struct scatterlist *scatterwalk_sg_next(struct scatterlist *sg) |
63 | { | 64 | { |
65 | if (sg_is_last(sg)) | ||
66 | return NULL; | ||
67 | |||
64 | return (++sg)->length ? sg : (void *)sg_page(sg); | 68 | return (++sg)->length ? sg : (void *)sg_page(sg); |
65 | } | 69 | } |
66 | 70 | ||