There is a bug in the CKRM CPU scheduler. This has been reported to the
[linux-2.6.git] / crypto / cipher.c
index 9abe5b9..6ab56eb 100644 (file)
@@ -52,8 +52,8 @@ static int crypt(struct crypto_tfm *tfm,
 {
        struct scatter_walk walk_in, walk_out;
        const unsigned int bsize = crypto_tfm_alg_blocksize(tfm);
-       u8 tmp_src[nbytes > src->length ? bsize : 0];
-       u8 tmp_dst[nbytes > dst->length ? bsize : 0];
+       u8 tmp_src[bsize];
+       u8 tmp_dst[bsize];
 
        if (!nbytes)
                return 0;
@@ -68,19 +68,20 @@ static int crypt(struct crypto_tfm *tfm,
 
        for(;;) {
                u8 *src_p, *dst_p;
+               int in_place;
 
                scatterwalk_map(&walk_in, 0);
                scatterwalk_map(&walk_out, 1);
                src_p = scatterwalk_whichbuf(&walk_in, bsize, tmp_src);
                dst_p = scatterwalk_whichbuf(&walk_out, bsize, tmp_dst);
+               in_place = scatterwalk_samebuf(&walk_in, &walk_out,
+                                              src_p, dst_p);
 
                nbytes -= bsize;
 
                scatterwalk_copychunks(src_p, &walk_in, bsize, 0);
 
-               prfn(tfm, dst_p, src_p, crfn, enc, info,
-                    scatterwalk_samebuf(&walk_in, &walk_out,
-                                        src_p, dst_p));
+               prfn(tfm, dst_p, src_p, crfn, enc, info, in_place);
 
                scatterwalk_done(&walk_in, 0, nbytes);