]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: caam - fix descriptor length adjustments for protocol descriptors
authorKim Phillips <kim.phillips@freescale.com>
Sat, 23 Jun 2012 00:42:38 +0000 (19:42 -0500)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 27 Jun 2012 06:42:03 +0000 (14:42 +0800)
commit602b7271b6d1915d00f1ac952ba664a33cbe58a9
treea1d6177be775cd45fc8e7dc682892d262c8b97a1
parenta69dc751e3f1b68eea635c4fd1189aa15dcf854f
crypto: caam - fix descriptor length adjustments for protocol descriptors

init_desc, by always ORing with 1 for the descriptor header inclusion
into the descriptor length, and init_sh_desc_pdb, by always specifying
the descriptor length modification for the PDB via options, would not
allow for odd length PDBs to be embedded in the constructed descriptor
length.  Fix this by simply changing the OR to an addition.

also round-up pdb_bytes to the next SEC command unit size, to
allow for, e.g., optional packet header bytes that aren't a
multiple of CAAM_CMD_SZ.

Reported-by: Radu-Andrei BULIE <radu.bulie@freescale.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Cc: Yashpal Dutta <yashpal.dutta@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/caam/desc_constr.h