Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.6.24.5-rc2 /crypto/xcbc.c

Filename:/crypto/xcbc.c
Lines Added:9
Lines Deleted:8
Also changed in: (Previous) 2.6.24.5-rc1  2.6.24.4  2.6.24.4-rc3  2.6.24.4-rc2  2.6.24.4-rc1  2.6.24-git22 
(Following) 2.6.24.5  2.6.24.6  2.6.24.7 

Location
[  2.6.24.5-rc2
  [  crypto
     o  xcbc.c

Patch

diff --git a/crypto/xcbc.c b/crypto/xcbc.c
index a957373..25a1537 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 = sg_next(sg);
+   }
 
    return 0;
 }


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.