From 7291a932c6e27d9768e374e9d648086636daf61c Mon Sep 17 00:00:00 2001 From: Wei Yongjun Date: Fri, 28 Sep 2012 12:52:25 +0800 Subject: crypto: talitos - convert to use be16_add_cpu() Convert cpu_to_be16(be16_to_cpu(E1) + E2) to use be16_add_cpu(). dpatch engine is used to auto generate this patch. (https://github.com/weiyj/dpatch) Signed-off-by: Wei Yongjun Signed-off-by: Herbert Xu --- drivers/crypto/talitos.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/crypto') diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index da1112765a44..09b184adf31b 100644 --- a/drivers/crypto/talitos.c +++ b/drivers/crypto/talitos.c @@ -936,8 +936,7 @@ static int sg_to_link_tbl(struct scatterlist *sg, int sg_count, sg_count--; link_tbl_ptr--; } - link_tbl_ptr->len = cpu_to_be16(be16_to_cpu(link_tbl_ptr->len) - + cryptlen); + be16_add_cpu(&link_tbl_ptr->len, cryptlen); /* tag end of link table */ link_tbl_ptr->j_extent = DESC_PTR_LNKTBL_RETURN; -- cgit v1.2.1 From 3200da8d9afb3d0dc617515a2fe364d9d59ef523 Mon Sep 17 00:00:00 2001 From: Wei Yongjun Date: Sun, 21 Oct 2012 19:56:42 +0800 Subject: crypto: tegra - fix missing unlock on error case Add the missing unlock on the error handling path in function tegra_aes_get_random() and tegra_aes_rng_reset(). Signed-off-by: Wei Yongjun Signed-off-by: Herbert Xu --- drivers/crypto/tegra-aes.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'drivers/crypto') diff --git a/drivers/crypto/tegra-aes.c b/drivers/crypto/tegra-aes.c index 37185e6630cd..19adf1c7faa2 100644 --- a/drivers/crypto/tegra-aes.c +++ b/drivers/crypto/tegra-aes.c @@ -674,8 +674,10 @@ static int tegra_aes_get_random(struct crypto_rng *tfm, u8 *rdata, mutex_lock(&aes_lock); ret = clk_prepare_enable(dd->aes_clk); - if (ret) + if (ret) { + mutex_unlock(&aes_lock); return ret; + } ctx->dd = dd; dd->ctx = ctx; @@ -759,8 +761,10 @@ static int tegra_aes_rng_reset(struct crypto_rng *tfm, u8 *seed, dd->flags = FLAGS_ENCRYPT | FLAGS_RNG; ret = clk_prepare_enable(dd->aes_clk); - if (ret) + if (ret) { + mutex_unlock(&aes_lock); return ret; + } aes_set_key(dd); -- cgit v1.2.1 From d48e366e6efe46e0a6744980c18582fb0919a727 Mon Sep 17 00:00:00 2001 From: Wei Yongjun Date: Thu, 25 Oct 2012 22:55:04 +0800 Subject: crypto: tegra-aes - fix error-valued pointer dereference clk_put(dd->aes_clk) will dereference an error-valued pointer since the dd->aes_clk is a ERR_PTR() value. The correct check is call clk_put() if !IS_ERR(dd->aes_clk). dpatch engine is used to auto generate this patch. (https://github.com/weiyj/dpatch) Signed-off-by: Wei Yongjun Signed-off-by: Herbert Xu --- drivers/crypto/tegra-aes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/crypto') diff --git a/drivers/crypto/tegra-aes.c b/drivers/crypto/tegra-aes.c index 19adf1c7faa2..93059dc591aa 100644 --- a/drivers/crypto/tegra-aes.c +++ b/drivers/crypto/tegra-aes.c @@ -1035,7 +1035,7 @@ out: if (dd->buf_out) dma_free_coherent(dev, AES_HW_DMA_BUFFER_SIZE_BYTES, dd->buf_out, dd->dma_buf_out); - if (IS_ERR(dd->aes_clk)) + if (!IS_ERR(dd->aes_clk)) clk_put(dd->aes_clk); if (aes_wq) destroy_workqueue(aes_wq); -- cgit v1.2.1 From d87d77128f2e837435efa5ff0fd9a32ffbc4bdc8 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 31 Oct 2012 20:08:37 +0100 Subject: crypto: omap-aes - select BLKCIPHER2 without it: |drivers/built-in.o:(.data+0x14588): undefined reference to `crypto_ablkcipher_type' |drivers/built-in.o:(.data+0x14668): undefined reference to `crypto_ablkcipher_type' Not sure when this broke. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Herbert Xu --- drivers/crypto/Kconfig | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/crypto') diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig index 308c7fb92a60..ac7235ac43d2 100644 --- a/drivers/crypto/Kconfig +++ b/drivers/crypto/Kconfig @@ -254,6 +254,7 @@ config CRYPTO_DEV_OMAP_AES tristate "Support for OMAP AES hw engine" depends on ARCH_OMAP2 || ARCH_OMAP3 select CRYPTO_AES + select CRYPTO_BLKCIPHER2 help OMAP processors have AES module accelerator. Select this if you want to use the OMAP module for AES algorithms. -- cgit v1.2.1 From 14198dd64b56749365c57503f51d5dcde875807d Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Sun, 4 Nov 2012 23:36:25 +0800 Subject: crypto: picoxcell - Add terminating entry for platform_device_id table The platform_device_id table is supposed to be zero-terminated. Signed-off-by: Axel Lin Acked-by: Jamie Iles Acked-by: David S. Miller Signed-off-by: Herbert Xu --- drivers/crypto/picoxcell_crypto.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/crypto') diff --git a/drivers/crypto/picoxcell_crypto.c b/drivers/crypto/picoxcell_crypto.c index 410a03c01ca4..c983f869d2b7 100644 --- a/drivers/crypto/picoxcell_crypto.c +++ b/drivers/crypto/picoxcell_crypto.c @@ -1863,6 +1863,7 @@ static int __devexit spacc_remove(struct platform_device *pdev) static const struct platform_device_id spacc_id_table[] = { { "picochip,spacc-ipsec", }, { "picochip,spacc-l2", }, + { } }; static struct platform_driver spacc_driver = { -- cgit v1.2.1 From a465348ff5d3e564ae0bcde63d5ef2066c079aad Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Thu, 8 Nov 2012 11:52:00 +0530 Subject: crypto: s5p-sss - Fix compilation error struct s3c2410_dma_client gets defined multiple times as it is defined in more than one header file. Changing it at the header file level causes many more build breakages as they are interdependent in a complex way. Hence fixing this problem by using the mach version of the header file. Without this patch, following build error is observed: arch/arm/plat-samsung/include/plat/dma-pl330.h:106:27: error: redefinition of struct s3c2410_dma_client Signed-off-by: Sachin Kamat Signed-off-by: Herbert Xu --- drivers/crypto/s5p-sss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/crypto') diff --git a/drivers/crypto/s5p-sss.c b/drivers/crypto/s5p-sss.c index a22714412cda..49ad8cbade69 100644 --- a/drivers/crypto/s5p-sss.c +++ b/drivers/crypto/s5p-sss.c @@ -30,7 +30,7 @@ #include #include -#include +#include #define _SBF(s, v) ((v) << (s)) #define _BIT(b) _SBF(b, 1) -- cgit v1.2.1