Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6

Pull crypto fixes from Herbert Xu:
 "This push fixes an error in sha512_ssse3 that leads to incorrect
  output as well as a memory leak in caam_jr when the module is
  unloaded"

* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: caam - fix memleak in caam_jr module
  crypto: sha512_ssse3 - fix byte count to bit count conversion
This commit is contained in:
Linus Torvalds 2014-07-10 11:30:57 -07:00
commit 9ab6e6e7db
2 changed files with 4 additions and 6 deletions

View file

@ -141,7 +141,7 @@ static int sha512_ssse3_final(struct shash_desc *desc, u8 *out)
/* save number of bits */ /* save number of bits */
bits[1] = cpu_to_be64(sctx->count[0] << 3); bits[1] = cpu_to_be64(sctx->count[0] << 3);
bits[0] = cpu_to_be64(sctx->count[1] << 3) | sctx->count[0] >> 61; bits[0] = cpu_to_be64(sctx->count[1] << 3 | sctx->count[0] >> 61);
/* Pad out to 112 mod 128 and append length */ /* Pad out to 112 mod 128 and append length */
index = sctx->count[0] & 0x7f; index = sctx->count[0] & 0x7f;

View file

@ -453,8 +453,8 @@ static int caam_jr_probe(struct platform_device *pdev)
int error; int error;
jrdev = &pdev->dev; jrdev = &pdev->dev;
jrpriv = kmalloc(sizeof(struct caam_drv_private_jr), jrpriv = devm_kmalloc(jrdev, sizeof(struct caam_drv_private_jr),
GFP_KERNEL); GFP_KERNEL);
if (!jrpriv) if (!jrpriv)
return -ENOMEM; return -ENOMEM;
@ -487,10 +487,8 @@ static int caam_jr_probe(struct platform_device *pdev)
/* Now do the platform independent part */ /* Now do the platform independent part */
error = caam_jr_init(jrdev); /* now turn on hardware */ error = caam_jr_init(jrdev); /* now turn on hardware */
if (error) { if (error)
kfree(jrpriv);
return error; return error;
}
jrpriv->dev = jrdev; jrpriv->dev = jrdev;
spin_lock(&driver_data.jr_alloc_lock); spin_lock(&driver_data.jr_alloc_lock);