]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00215492-1: Fix DMA size in extended descriptor for ahash_digest()
authorSteve Cornelius <steve.cornelius@freescale.com>
Fri, 29 Jun 2012 22:53:46 +0000 (15:53 -0700)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:34:55 +0000 (08:34 +0200)
Save of DMA size in extended descriptor was missing, thus crashes could
occur during post-request unmapping.

Also, removed lingering DEBUG def that shouldn't have been there.

Signed-off-by: Steve Cornelius <steve.cornelius@freescale.com>
Signed-off-by: Terry Lv <r65388@freescale.com>
drivers/crypto/caam/caamhash.c

index 85eaa95eda3eb2d460a514c24283db6307ac1804..d36582b0c0721d4e020f8259165520f35ecfded6 100644 (file)
@@ -89,7 +89,6 @@
 #define HASH_MSG_LEN                   8
 #define MAX_CTX_LEN                    (HASH_MSG_LEN + SHA512_DIGEST_SIZE)
 
-#define DEBUG
 #ifdef DEBUG
 /* for print_hex_dumps with line references */
 #define xstr(s) str(s)
@@ -1095,6 +1094,7 @@ static int ahash_digest(struct ahash_request *req)
                          DESC_JOB_IO_LEN;
        edesc->sec4_sg_dma = dma_map_single(jrdev, edesc->sec4_sg,
                                            sec4_sg_bytes, DMA_TO_DEVICE);
+       edesc->sec4_sg_bytes = sec4_sg_bytes;
        dma_sync_single_for_device(jrdev, edesc->sec4_sg_dma, sec4_sg_bytes,
                                   DMA_TO_DEVICE);
        edesc->src_nents = src_nents;