[PATCH -next] crypto: hisilicon/hpre - fix build error without CONFIG_CRYPTO_ECDH

2021-03-24 Thread 'Wei Yongjun
From: Wei Yongjun GCC reports build error as following: x86_64-linux-gnu-ld: drivers/crypto/hisilicon/hpre/hpre_crypto.o: in function `hpre_ecdh_set_secret': hpre_crypto.c:(.text+0x269c): undefined reference to `crypto_ecdh_decode_key' Fix it by selecting CRYPTO_ECDH. Reported-by:

[PATCH -next] crypto: keembay-ocs-aes - Fix error return code in kmb_ocs_aes_probe()

2021-02-09 Thread Wei Yongjun
Fix to return negative error code -ENOMEM from the error handling case instead of 0, as done elsewhere in this function. Fixes: 885743324513 ("crypto: keembay - Add support for Keem Bay OCS AES/SM4") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun --- drivers/crypto/keembay/keemb

[PATCH -next] crypto: keembay-ocs-hcu - Fix error return code in kmb_ocs_hcu_probe()

2021-02-09 Thread Wei Yongjun
Fix to return negative error code -ENOMEM from the error handling case instead of 0, as done elsewhere in this function. Fixes: 472b0cd3 ("crypto: keembay - Add Keem Bay OCS HCU driver") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun --- drivers/crypto/keembay/keembay-ocs-

[PATCH] crypto: ingenic - Drop kfree for memory allocated with devm_kzalloc

2020-08-04 Thread Wei Yongjun
It's not necessary to free memory allocated with devm_kzalloc and using kfree leads to a double free. Fixes: 190873a0ea45 ("crypto: ingenic - Add hardware RNG for Ingenic JZ4780 and X1000") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun --- drivers/char/hw_random/in

[PATCH -next] crypto: sa2ul - fix wrong pointer passed to PTR_ERR()

2020-07-24 Thread Wei Yongjun
PTR_ERR should access the value just tested by IS_ERR, otherwise the wrong error code will be returned. Fixes: 7694b6ca649f ("crypto: sa2ul - Add crypto driver") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun --- drivers/crypto/sa2ul.c | 2 +- 1 file changed, 1 insertion(+),

[PATCH] KEYS: asymmetric: fix error return code in software_key_query()

2020-06-22 Thread Wei Yongjun
Fix to return negative error code -ENOMEM from kmalloc() error handling case instead of 0, as done elsewhere in this function. Fixes: f1774cb8956a ("X.509: parse public key parameters from x509 for akcipher") Signed-off-by: Wei Yongjun --- crypto/asymmetric_keys/public_key.c | 2

[PATCH -next] cxgb4/chcr: Fix error return code in chcr_ktls_dev_add()

2020-05-09 Thread Wei Yongjun
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 34aba2c45024 ("cxgb4/chcr : Register to tls add and del callback") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun --- drivers/crypto/chelsio/chcr_ktls.c | 3 +

[PATCH -next] crypto: drbg - fix error return code in drbg_alloc_state()

2020-04-30 Thread Wei Yongjun
Fix to return negative error code -ENOMEM from the kzalloc error handling case instead of 0, as done elsewhere in this function. Fixes: db07cd26ac6a ("crypto: drbg - add FIPS 140-2 CTRNG for noise source") Signed-off-by: Wei Yongjun --- crypto/drbg.c | 4 +++- 1 file changed, 3 insert

[PATCH] crypto: cavium/zip - Add missing single_release()

2019-09-04 Thread Wei Yongjun
When using single_open() for opening, single_release() should be used instead of seq_release(), otherwise there is a memory leak. Fixes: 09ae5d37e093 ("crypto: zip - Add Compression/Decompression statistics") Signed-off-by: Wei Yongjun --- drivers/crypto/cavium/zip/zip_main.c | 3 +

[PATCH -next] hwrng: make symbol 'optee_rng_id_table' static

2019-02-20 Thread Wei Yongjun
Fixes the following sparse warning: drivers/char/hw_random/optee-rng.c:265:35: warning: symbol 'optee_rng_id_table' was not declared. Should it be static? Fixes: 5fe8b1cc6a03 ("hwrng: add OP-TEE based rng driver") Signed-off-by: Wei Yongjun --- drivers/char/hw_random/o

[PATCH -next] crypto: mxs-dcp: make symbols 'sha1_null_hash' and 'sha256_null_hash' static

2018-10-10 Thread Wei Yongjun
crypto: mxs-dcp - Fix SHA null hashes and output length") Signed-off-by: Wei Yongjun --- drivers/crypto/mxs-dcp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/mxs-dcp.c b/drivers/crypto/mxs-dcp.c index 849a81e..4e6ff32 100644 --- a/drivers/crypto/mxs-

[PATCH -next v2] crypto: ccp - Make function sev_get_firmware() static

2018-09-25 Thread Wei Yongjun
Fixes the following sparse warning: drivers/crypto/ccp/psp-dev.c:444:5: warning: symbol 'sev_get_firmware' was not declared. Should it be static? Fixes: e93720606efd ("crypto: ccp - Allow SEV firmware to be chosen based on Family and Model") Signed-off-by: Wei Yongjun ---

[PATCH -next] crypto: ccp - Make function sev_get_firmware() static

2018-09-25 Thread Wei Yongjun
Fixes the following sparse warning: drivers/crypto/ccp/psp-dev.c:444:5: warning: symbol 'sev_get_firmware' was not declared. Should it be static? Signed-off-by: Wei Yongjun --- drivers/crypto/ccp/psp-dev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/driv

[PATCH -next] crypto: hisilicon - Make function sec_send_request() static

2018-08-07 Thread Wei Yongjun
Fixes the following sparse warning: drivers/crypto/hisilicon/sec/sec_algs.c:396:5: warning: symbol 'sec_send_request' was not declared. Should it be static? Fixes: 915e4e8413da ("crypto: hisilicon - SEC security accelerator driver") Signed-off-by: Wei Yongjun --- drivers/

[PATCH -next] crypto: fix missing unlock on error in safexcel_ahash_send_req()

2018-03-13 Thread Wei Yongjun
Add the missing unlock before return from function safexcel_ahash_send_req() in the error handling case. Fixes: cff9a17545a3 ("crypto: inside-secure - move cache result dma mapping to request") Signed-off-by: Wei Yongjun --- drivers/crypto/inside-secure/safexcel_hash.c | 4 +++- 1 fi

[PATCH -next] hwrng: make symbol imx_rngc_pm_ops static

2018-01-22 Thread Wei Yongjun
Fixes the following sparse warnings: drivers/char/hw_random/imx-rngc.c:303:1: warning: symbol 'imx_rngc_pm_ops' was not declared. Should it be static? Signed-off-by: Wei Yongjun --- drivers/char/hw_random/imx-rngc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH -next] crypto: stm32 - remove redundant dev_err call in stm32_cryp_probe()

2018-01-17 Thread Wei Yongjun
There is a error message within devm_ioremap_resource already, so remove the dev_err call to avoid redundant error message. Signed-off-by: Wei Yongjun --- drivers/crypto/stm32/stm32-cryp.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/crypto/stm32/stm32-cryp.c

[PATCH -next] hwrng: bcm2835 - Remove redundant dev_err call in bcm2835_rng_probe()

2018-01-17 Thread Wei Yongjun
There is a error message within devm_ioremap_resource already, so remove the dev_err call to avoid redundant error message. Signed-off-by: Wei Yongjun --- drivers/char/hw_random/bcm2835-rng.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/char/hw_random/bcm2835

[PATCH -next] crypto: axis - remove unnecessary platform_get_resource() error check

2018-01-17 Thread Wei Yongjun
devm_ioremap_resource() already checks if the resource is NULL, so remove the unnecessary platform_get_resource() error check. Signed-off-by: Wei Yongjun --- drivers/crypto/axis/artpec6_crypto.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/crypto/axis/artpec6_crypto.c b

[PATCH -next] staging: ccree: remove redundant dev_err call in init_cc_resources()

2018-01-11 Thread Wei Yongjun
There is a error message within devm_ioremap_resource already, so remove the dev_err call to avoid redundant error message. Signed-off-by: Wei Yongjun --- drivers/staging/ccree/cc_driver.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/ccree/cc_driver.c

[PATCH -next] hwrng: exynos - remove redundant dev_err call in exynos_trng_probe()

2018-01-10 Thread Wei Yongjun
There is a error message within devm_ioremap_resource already, so remove the dev_err call to avoid redundant error message. Signed-off-by: Wei Yongjun --- drivers/char/hw_random/exynos-trng.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/char/hw_random/exynos

[PATCH -next] crypto: stm32 - Fix OF module alias information

2017-04-25 Thread Wei Yongjun
From: Wei Yongjun The module alias information passed to MODULE_DEVICE_TABLE() should use stm32_dt_ids instead of undefined sti_dt_ids. Fixes: b51dbe90912a ("crypto: stm32 - Support for STM32 CRC32 crypto module") Signed-off-by: Wei Yongjun --- drivers/crypto/stm32/stm32_crc32.c

[PATCH -next] crypto: caam - fix error return code in caam_qi_init()

2017-04-11 Thread Wei Yongjun
From: Wei Yongjun Fix to return error code -ENOMEM from the kmem_cache_create() error handling case instead of 0(err is 0 here), as done elsewhere in this function. Fixes: 67c2315def06 ("crypto: caam - add Queue Interface (QI) backend support") Signed-off-by: Wei Yongjun --- driv

[PATCH -next] crypto: asymmetric_keys - Fix error return code on failure

2017-02-09 Thread Wei Yongjun
From: Wei Yongjun Fix to return error code -ENOMEM from the akcipher_request_alloc() error handling case instead of 0. Signed-off-by: Wei Yongjun --- crypto/asymmetric_keys/public_key.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/crypto/asymmetric_keys

[PATCH -next] crypto: mediatek - make symbol of_crypto_id static

2017-01-12 Thread Wei Yongjun
From: Wei Yongjun Fixes the following sparse warning: drivers/crypto/mediatek/mtk-platform.c:585:27: warning: symbol 'of_crypto_id' was not declared. Should it be static? Signed-off-by: Wei Yongjun --- drivers/crypto/mediatek/mtk-platform.c | 2 +- 1 file changed, 1 insertion(+),

[PATCH -next] hwrng: atmel - use clk_disable_unprepare instead of clk_disable

2016-11-11 Thread Wei Yongjun
From: Wei Yongjun Since clk_prepare_enable() is used to get trng->clk, we should use clk_disable_unprepare() to release it for the error path. Signed-off-by: Wei Yongjun --- drivers/char/hw_random/atmel-rng.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/c

[PATCH -next] crypto: drop pointless static qualifier in atmel_aes_probe()

2016-10-24 Thread Wei Yongjun
From: Wei Yongjun There is no need to have the 'struct atmel_aes_dev *aes_dd' variable static since new value always be assigned before use it. Signed-off-by: Wei Yongjun --- drivers/crypto/atmel-aes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cr

[PATCH -next] crypto: ccp - Fix non static symbol warning

2016-10-17 Thread Wei Yongjun
From: Wei Yongjun Fixes the following sparse warning: drivers/crypto/ccp/ccp-dev.c:44:6: warning: symbol 'ccp_error_codes' was not declared. Should it be static? Signed-off-by: Wei Yongjun --- drivers/crypto/ccp/ccp-dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) di

[PATCH -next] crypto: gcm - Fix error return code in crypto_gcm_create_common()

2016-10-17 Thread Wei Yongjun
From: Wei Yongjun Fix to return error code -EINVAL from the invalid alg ivsize error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun --- crypto/gcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/gcm.c b/crypto/gcm.c

[PATCH] crypto: ccp - Fix return value check in ccp_dmaengine_register()

2016-09-17 Thread Wei Yongjun
From: Wei Yongjun Fix the retrn value check which testing the wrong variable in ccp_dmaengine_register(). Fixes: 58ea8abf4904 ("crypto: ccp - Register the CCP as a DMA resource") Signed-off-by: Wei Yongjun --- drivers/crypto/ccp/ccp-dmaengine.c | 2 +- 1 file changed, 1 inser

[PATCH -next] hwrng: geode - fix return value check in mod_init()

2016-09-15 Thread Wei Yongjun
From: Wei Yongjun In case of error, the function devm_ioremap() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Fixes: 6e9b5e76882c ("hwrng: geode - Migrate to managed API") Signed-off-by: Wei Yongjun --- dr

[PATCH -next] hwrng: amd - Fix return value check in mod_init()

2016-09-15 Thread Wei Yongjun
From: Wei Yongjun In case of error, the function devm_kzalloc() or devm_ioport_map() return NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Fixes: 31b2a73c9c5f ("hwrng: amd - Migrate to managed API") Signed-off-by: W

[PATCH -next] crypto: ccp - use kmem_cache_zalloc instead of kmem_cache_alloc/memset

2016-09-14 Thread Wei Yongjun
From: Wei Yongjun Using kmem_cache_zalloc() instead of kmem_cache_alloc() and memset(). Signed-off-by: Wei Yongjun --- drivers/crypto/ccp/ccp-dmaengine.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/crypto/ccp/ccp-dmaengine.c b/drivers/crypto/ccp/ccp

[PATCH -next] crypto: omap-aes - fix error return code in omap_aes_probe()

2016-09-14 Thread Wei Yongjun
From: Wei Yongjun Fix to return error code -ENOMEM from the crypto_engine_alloc_init() error handling case instead of 0, as done elsewhere in this function. Fixes: 0529900a01cb ("crypto: omap-aes - Support crypto engine framework") Signed-off-by: Wei Yongjun --- drivers/crypto/omap

[PATCH -next] crypto: omap-des - fix error return code in omap_des_probe()

2016-09-14 Thread Wei Yongjun
From: Wei Yongjun Fix to return error code -ENOMEM from the crypto_engine_alloc_init() error handling case instead of 0, as done elsewhere in this function. Fixes: f1b77aaca85a ("crypto: omap-des - Integrate with the crypto engine framework") Signed-off-by: Wei Yongjun --- drivers/c

[PATCH -next] hwrng: st - Fix missing clk_disable_unprepare() on error in st_rng_probe()

2016-09-10 Thread Wei Yongjun
From: Wei Yongjun Fix the missing clk_disable_unprepare() before return from st_rng_probe() in the error handling case. Signed-off-by: Wei Yongjun --- drivers/char/hw_random/st-rng.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/char/hw_random/st-rng.c b/drivers/char/hw_random

[PATCH -next v2] chcr: Fix non static symbol warning

2016-08-26 Thread Wei Yongjun
From: Wei Yongjun Fixes the following sparse warning: drivers/crypto/chelsio/chcr_algo.c:593:5: warning: symbol 'cxgb4_is_crypto_q_full' was not declared. Should it be static? Signed-off-by: Wei Yongjun --- v1 -> v2: cc netdev maillist --- drivers/crypto/chelsio/chcr_algo.c |

Re: [PATCH -next] chcr: Fix non static symbol warning

2016-08-24 Thread Wei Yongjun
Hi Herbert, On 08/24/2016 09:06 PM, Herbert Xu wrote: > On Mon, Aug 22, 2016 at 04:11:18PM +0000, Wei Yongjun wrote: >> From: Wei Yongjun >> >> Fixes the following sparse warning: >> >> drivers/crypto/chelsio/chcr_algo.c:593:5: warning: >> symbol &#

[PATCH -next] chcr: Fix non static symbol warning

2016-08-22 Thread Wei Yongjun
From: Wei Yongjun Fixes the following sparse warning: drivers/crypto/chelsio/chcr_algo.c:593:5: warning: symbol 'cxgb4_is_crypto_q_full' was not declared. Should it be static? Signed-off-by: Wei Yongjun --- drivers/crypto/chelsio/chcr_algo.c | 2 +- 1 file changed, 1 inser

[PATCH -next] crypto: drbg - fix error return code

2016-08-20 Thread Wei Yongjun
Fix to return a negative error code from the error handling case instead of 0. Signed-off-by: Wei Yongjun --- crypto/drbg.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/crypto/drbg.c b/crypto/drbg.c index edf3ce0..fb33f7d 100644 --- a/crypto/drbg.c +++ b

[PATCH -next v2] crypto: sun4i-ss - fix missing unlock on error in sun4i_hash()

2016-08-20 Thread Wei Yongjun
Add the missing unlock before return from function sun4i_hash() in the error handling case. Fixes: 477d9b2e591b ("crypto: sun4i-ss - unify update/final function") Signed-off-by: Wei Yongjun --- v1 -> v2: goto release_ss as LABBE Corentin's suggestion --- drivers/crypto/sunxi-

[PATCH -next] crypto: fix missing unlock on error in sun4i_hash()

2016-08-18 Thread Wei Yongjun
Add the missing unlock before return from function sun4i_hash() in the error handling case. Fixes: 477d9b2e591b ("crypto: sun4i-ss - unify update/final function") Signed-off-by: Wei Yongjun --- drivers/crypto/sunxi-ss/sun4i-ss-hash.c | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH -next] crypto: ccp - Fix non static symbol warning

2016-08-11 Thread Wei Yongjun
Fixes the following sparse warning: drivers/crypto/ccp/ccp-dev.c:62:14: warning: symbol 'ccp_increment_unit_ordinal' was not declared. Should it be static? Signed-off-by: Wei Yongjun --- drivers/crypto/ccp/ccp-dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH -next] crypto: mxs - Fix sparse non static symbol warning

2014-01-08 Thread Wei Yongjun
From: Wei Yongjun Fixes the following sparse warning: drivers/crypto/mxs-dcp.c:103:1: warning: symbol 'global_mutex' was not declared. Should it be static? Signed-off-by: Wei Yongjun --- drivers/crypto/mxs-dcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH] crypto: hifn_795x - fix to pass correct device identity to free_irq()

2013-05-28 Thread Wei Yongjun
From: Wei Yongjun free_irq() expects the same device identity that was passed to request_irq(), otherwise the IRQ is not freed. Signed-off-by: Wei Yongjun --- drivers/crypto/hifn_795x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/hifn_795x.c b

[PATCH -next] crypto: ux500 - fix error return code in hash_dma_final()

2013-03-22 Thread Wei Yongjun
From: Wei Yongjun Fix to return a negative error code from the error handling case instead of 0, as returned elsewhere in this function. Signed-off-by: Wei Yongjun --- drivers/crypto/ux500/hash/hash_core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/crypto/ux500/hash

[PATCH] crypto: tegra-aes - fix error-valued pointer dereference

2012-10-25 Thread Wei Yongjun
From: Wei Yongjun 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-of

[PATCH] crypto: fix missing unlock on error case

2012-10-21 Thread Wei Yongjun
From: Wei Yongjun 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 --- drivers/crypto/tegra-aes.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/tegra-aes.c b

[PATCH] crypto: convert to use be16_add_cpu()

2012-09-27 Thread Wei Yongjun
From: Wei Yongjun 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 --- drivers/crypto/talitos.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git

[PATCH] crypto: remove duplicated include

2012-08-25 Thread Wei Yongjun
From: Wei Yongjun From: Wei Yongjun Remove duplicated include. Signed-off-by: Wei Yongjun --- drivers/crypto/atmel-aes.c | 5 - drivers/crypto/atmel-sha.c | 5 - drivers/crypto/atmel-tdes.c | 5 - 3 files changed, 15 deletions(-) diff --git a/drivers/crypto/atmel-aes.c b