diff options
author | David S. Miller <davem@davemloft.net> | 2008-04-03 14:33:42 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-04-03 14:33:42 -0700 |
commit | 3bb5da3837cc1aa17736b05139c9a22c3794851a (patch) | |
tree | c92d5684a866542b1cb20641607ac1643ce03a47 /crypto | |
parent | 7feb49c82a74bc7c091b8ab2a3f96baa33d08ece (diff) | |
parent | 9597362d354f8655ece324b01d0c640a0e99c077 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/async_tx/async_xor.c | 2 | ||||
-rw-r--r-- | crypto/xcbc.c | 17 |
2 files changed, 10 insertions, 9 deletions
diff --git a/crypto/async_tx/async_xor.c b/crypto/async_tx/async_xor.c index 7a9db353f198..1c445c7bdab7 100644 --- a/crypto/async_tx/async_xor.c +++ b/crypto/async_tx/async_xor.c @@ -271,7 +271,7 @@ async_xor_zero_sum(struct page *dest, struct page **src_list, BUG_ON(src_cnt <= 1); - if (device) { + if (device && src_cnt <= device->max_xor) { dma_addr_t *dma_src = (dma_addr_t *) src_list; unsigned long dma_prep_flags = cb_fn ? DMA_PREP_INTERRUPT : 0; int i; diff --git a/crypto/xcbc.c b/crypto/xcbc.c index 2feb0f239c38..b63b633e549c 100644 --- a/crypto/xcbc.c +++ b/crypto/xcbc.c @@ -116,13 +116,11 @@ static int crypto_xcbc_digest_update2(struct hash_desc *pdesc, struct crypto_xcbc_ctx *ctx = crypto_hash_ctx_aligned(parent); struct crypto_cipher *tfm = ctx->child; int bs = crypto_hash_blocksize(parent); - unsigned int i = 0; - do { - - struct page *pg = sg_page(&sg[i]); - unsigned int offset = sg[i].offset; - unsigned int slen = sg[i].length; + for (;;) { + struct page *pg = sg_page(sg); + unsigned int offset = sg->offset; + unsigned int slen = sg->length; if (unlikely(slen > nbytes)) slen = nbytes; @@ -182,8 +180,11 @@ static int crypto_xcbc_digest_update2(struct hash_desc *pdesc, offset = 0; pg++; } - i++; - } while (nbytes>0); + + if (!nbytes) + break; + sg = scatterwalk_sg_next(sg); + } return 0; } |