UBUNTU: Ubuntu-2.6.38-12.51
[linux-flexiantxendom0-natty.git] / crypto / blkcipher.c
index 185f955..7a72192 100644 (file)
@@ -89,9 +89,9 @@ static inline unsigned int blkcipher_done_fast(struct blkcipher_walk *walk,
                memcpy(walk->dst.virt.addr, walk->page, n);
                blkcipher_unmap_dst(walk);
        } else if (!(walk->flags & BLKCIPHER_WALK_PHYS)) {
-               blkcipher_unmap_src(walk);
                if (walk->flags & BLKCIPHER_WALK_DIFF)
                        blkcipher_unmap_dst(walk);
+               blkcipher_unmap_src(walk);
        }
 
        scatterwalk_advance(&walk->in, n);
@@ -124,6 +124,7 @@ int blkcipher_walk_done(struct blkcipher_desc *desc,
        scatterwalk_done(&walk->in, 0, nbytes);
        scatterwalk_done(&walk->out, 1, nbytes);
 
+err:
        walk->total = nbytes;
        walk->nbytes = nbytes;
 
@@ -132,7 +133,6 @@ int blkcipher_walk_done(struct blkcipher_desc *desc,
                return blkcipher_walk_next(desc, walk);
        }
 
-err:
        if (walk->iv != desc->info)
                memcpy(desc->info, walk->iv, crypto_blkcipher_ivsize(tfm));
        if (walk->buffer != walk->page)
@@ -521,7 +521,7 @@ static int crypto_grab_nivcipher(struct crypto_skcipher_spawn *spawn,
        int err;
 
        type = crypto_skcipher_type(type);
-       mask = crypto_skcipher_mask(mask) | CRYPTO_ALG_GENIV;
+       mask = crypto_skcipher_mask(mask)| CRYPTO_ALG_GENIV;
 
        alg = crypto_alg_mod_lookup(name, type, mask);
        if (IS_ERR(alg))
@@ -696,34 +696,5 @@ void skcipher_geniv_exit(struct crypto_tfm *tfm)
 }
 EXPORT_SYMBOL_GPL(skcipher_geniv_exit);
 
-static int __init blkcipher_module_init(void)
-{
-       int err;
-
-       err = chainiv_module_init();
-       if (err)
-               goto out;
-
-       err = eseqiv_module_init();
-       if (err)
-               goto eseqiv_err;
-
-out:
-       return err;
-
-eseqiv_err:
-       chainiv_module_exit();
-       goto out;
-}
-
-static void __exit blkcipher_module_exit(void)
-{
-       eseqiv_module_exit();
-       chainiv_module_exit();
-}
-
-module_init(blkcipher_module_init);
-module_exit(blkcipher_module_exit);
-
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("Generic block chaining cipher type");