From 238b2e9e0e4b2b0debd472498de7950fca7ae54c Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Wed, 2 Apr 2008 07:43:53 -0700 Subject: [PATCH] --- yaml --- r: 87997 b: refs/heads/master c: 6be9f7b2835fa442f6b892f174dabc4023c0af2e h: refs/heads/master i: 87995: 54b0c397a633bd0eb7448e6d3812b62e8209b4d2 v: v3 --- [refs] | 2 +- trunk/crypto/xcbc.c | 17 +++++++++-------- trunk/fs/afs/cell.c | 1 + 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/[refs] b/[refs] index a34a3f4a6c7e..a2860cc3ba79 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 34e6bbf23c8f43e8713d9bd092680f1660494b4a +refs/heads/master: 6be9f7b2835fa442f6b892f174dabc4023c0af2e diff --git a/trunk/crypto/xcbc.c b/trunk/crypto/xcbc.c index 2feb0f239c38..b63b633e549c 100644 --- a/trunk/crypto/xcbc.c +++ b/trunk/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; } diff --git a/trunk/fs/afs/cell.c b/trunk/fs/afs/cell.c index 788865df1bc9..584bb0f9c36a 100644 --- a/trunk/fs/afs/cell.c +++ b/trunk/fs/afs/cell.c @@ -138,6 +138,7 @@ struct afs_cell *afs_cell_create(const char *name, char *vllist) cell = afs_cell_alloc(name, vllist); if (IS_ERR(cell)) { _leave(" = %ld", PTR_ERR(cell)); + up_write(&afs_cells_sem); return cell; }