[PATCH] arm64/crypto: remove redundant update of data

2014-08-24 Thread Colin King
From: Colin Ian King Originally found by cppcheck: [arch/arm64/crypto/sha2-ce-glue.c:153]: (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it? Updating data by blocks * SHA256_BLOCK_SIZE at the end of ha2_finup is redundant code an

[PATCH] crypto: fix typo in dev_err error message

2015-02-28 Thread Colin King
From: Colin Ian King Fix typo, "intialization" -> "initialization" Signed-off-by: Colin Ian King --- drivers/crypto/atmel-aes.c | 2 +- drivers/crypto/atmel-sha.c | 2 +- drivers/crypto/atmel-tdes.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/atmel-a

[PATCH] crypto: ensure backlog is initialised

2015-04-14 Thread Colin King
From: Colin Ian King backlog is not initialised so in the case where cpg->eng_st != ENGINE_IDLE it is never initialised and hence which could lead to an illegal memory dereference in the statement: backlog->complete(backlog, -EINPROGRESS); Discovered with cppcheck static analsys: [drivers/cry

[PATCH] crypto: sahara: fix typo "Decidated" -> "Dedicated"

2016-10-25 Thread Colin King
From: Colin Ian King Trivial fix to typo in dev_dbg message Signed-off-by: Colin Ian King --- drivers/crypto/sahara.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/sahara.c b/drivers/crypto/sahara.c index 0c49956..7ba0eae 100644 --- a/drivers/crypto/sahara.

[PATCH] crypto: talitos: fix spelling mistake

2016-11-01 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake "pointeur" to "pointer" in dev_err message Signed-off-by: Colin Ian King --- drivers/crypto/talitos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index 0418a2f..0bba

[PATCH] crypto: mediatek: don't return garbage err on successful return

2017-01-03 Thread Colin King
From: Colin Ian King In the case where keylen <= bs mtk_sha_setkey returns an uninitialized return value in err. Fix this by returning 0 instead of err. Issue detected by static analysis with cppcheck. Signed-off-by: Colin Ian King --- drivers/crypto/mediatek/mtk-sha.c | 2 +- 1 file changed

[PATCH] crypto: atmel-sha: use %zu for size_t print format specifier

2017-02-07 Thread Colin King
From: Colin Ian King The size_t types should be using %zu as a format specifier rather than %d and %u. Signed-off-by: Colin Ian King --- drivers/crypto/atmel-sha.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto/a

[PATCH] crypto: cavium: fix leak on curr if curr->head fails to be allocated

2017-02-17 Thread Colin King
From: Colin Ian King The exit path when curr->head cannot be allocated fails to kfree the earlier allocated curr. Fix this by kfree'ing it. Signed-off-by: Colin Ian King --- drivers/crypto/cavium/cpt/cptvf_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/crypto/cavium/cpt/cp

[PATCH] crypto: brcm: fix spelling mistake: "genereate" -> "generate"

2017-02-22 Thread Colin King
From: Colin Ian King trivial fix to spelling mistake in pr_err message Signed-off-by: Colin Ian King --- drivers/crypto/bcm/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/bcm/util.c b/drivers/crypto/bcm/util.c index 0502f46..430c557 100644 --- a/drive

[PATCH] crypto: aesni: make arrays aesni_simd_skciphers and aesni_simd_skciphers2 static

2017-08-20 Thread Colin King
From: Colin Ian King Arrays aesni_simd_skciphers and aesni_simd_skciphers2 are local to the source and do not need to be in global scope, so make them static. Cleans up sparse warnings: symbol 'aesni_simd_skciphers' was not declared. Should it be static? symbol 'aesni_simd_skciphers2' was not de

[PATCH] crypto: algboss: remove redundant setting of len to zero

2017-09-14 Thread Colin King
From: Colin Ian King The variable len is set to zero, never read and then later updated to p - name, so clearly the zero'ing of len is redundant and can be removed. Detected by clang scan-build: " warning: Value stored to 'len' is never read" Signed-off-by: Colin Ian King --- crypto/algboss.c

[PATCH] staging: ccree: remove unused and redundant variable idx

2017-09-16 Thread Colin King
From: Colin Ian King Variable idx is being set but never read and thus it can be removed because it is redundant. Cleans up clang build warnings: warning: Value stored to 'idx' during its initialization is never read warning: Value stored to 'idx' is never read warning: Value stored to 'idx' is

[PATCH] crypto: cavium: clean up clang warning on unread variable offset

2017-10-12 Thread Colin King
From: Colin Ian King The variable offset is being assigned and not being used; it should be passed as the 2nd argument to call to function nitrox_write_csr but has been omitted. Fix this. Cleans up clang warning: Value stored to 'offset' is never read Fixes: 14fa93cdcd9b ("crypto: cavium - Add

[PATCH] crypto: ccp: remove unused variable qim

2017-10-12 Thread Colin King
From: Colin Ian King Variable qim is assigned but never read, it is redundant and can be removed. Cleans up clang warning: Value stored to 'qim' is never read Fixes: 4b394a232df7 ("crypto: ccp - Let a v5 CCP provide the same function as v3") Signed-off-by: Colin Ian King --- drivers/crypto/c

[PATCH] crypto: qat: remove unused and redundant pointer vf_info

2017-10-12 Thread Colin King
From: Colin Ian King The pointer vf_info is being assigned but never read, it is redundant and therefore can be removed. Cleans up clang warning: Value stored to 'vf_info' is never read Fixes: ed8ccaef52fa ("crypto: qat - Add support for SRIOV") Signed-off-by: Colin Ian King --- drivers/crypt

[PATCH] staging: ccree: remove unused pointer cc_base

2017-11-09 Thread Colin King
From: Colin Ian King Pointer cc_base is being assigned but is never read, hence it is redundant and can be removed. Cleans up clang warning: drivers/staging/ccree/ssi_driver.c:235:2: warning: Value stored to 'cc_base' is never read Signed-off-by: Colin Ian King --- drivers/staging/ccree/ssi_d

[PATCH] crypto: chelsio: remove redundant assignments to reqctx and dst_size

2017-11-09 Thread Colin King
From: Colin Ian King Pointer reqctx is assigned the same value twice, once on initialization and again a few statements later, remove the second redundant assignment. Variable dst_size is assigned but it is never read, so the variable is redundant and can be removed. Cleans up clang warnings: dr

[PATCH] crypto/nx: fix spelling mistake: "availavle" -> "available"

2017-11-14 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in pr_err error message text Signed-off-by: Colin Ian King --- drivers/crypto/nx/nx-842-powernv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/nx/nx-842-powernv.c b/drivers/crypto/nx/nx-842-powernv.c in

[PATCH][V2] crypto/nx: fix spelling mistake: "availavle" -> "available"

2017-11-14 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in pr_err error message text. Also fix spelling mistake in proceeding comment. Signed-off-by: Colin Ian King --- drivers/crypto/nx/nx-842-powernv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/nx/nx-

[PATCH] crypto: cavium: fix memory leak on info

2017-11-15 Thread Colin King
From: Colin Ian King The object info is being leaked on an error return path, fix this by setting ret to -ENOMEM and exiting via the request_cleanup path that will free info. Detected by CoverityScan, CID#1408439 ("Resource Leak") Fixes: c694b233295b ("crypto: cavium - Add the Virtual Function

[PATCH] staging: ccree: fix incorrect indentation of break statement

2017-11-17 Thread Colin King
From: Colin Ian King The break statement is indented one level too many, fix this. Signed-off-by: Colin Ian King --- drivers/staging/ccree/ssi_aead.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ccree/ssi_aead.c b/drivers/staging/ccree/ssi_aead.c index ba

[PATCH] crypto: cryptd: make cryptd_max_cpu_qlen module parameter static

2017-11-30 Thread Colin King
From: Colin Ian King The cryptd_max_cpu_qlen module parameter is local to the source and does not need to be in global scope, so make it static. Cleans up sparse warning: crypto/cryptd.c:35:14: warning: symbol 'cryptd_max_cpu_qlen' was not declared. Should it be static? Signed-off-by: Colin Ian

[PATCH] crypto: chelsio: make arrays sgl_ent_len and dsgl_ent_len static

2017-11-30 Thread Colin King
From: Colin Ian King The arrays sgl_ent_len and dsgl_ent_len are local to the source and do not need to be in global scope, so make them static. Also re-format the declarations to match the following round_constant array declaration style. Cleans up sparse warnings: drivers/crypto/chelsio/chcr_a

[PATCH] chcr: remove unused variables net_device, pi, adap and cntrl

2017-11-30 Thread Colin King
From: Colin Ian King Variables adap, pi and cntrl are assigned but are never read, hence they are redundant and can be removed. Cleans up various clang build warnings. Signed-off-by: Colin Ian King --- drivers/crypto/chelsio/chcr_ipsec.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletio

[PATCH] chcr: ensure cntrl is initialized to fix bit-wise or'ing of garabage data

2017-11-30 Thread Colin King
From: Colin Ian King In the case where skb->ip_summed != CHECKSUM_PARTIAL then cntrl contains garbage value and this is possibly being bit-wise or'd and stored into cpl->ctrl1. Fix this by initializing cntrl to zero. Cleans up clang warning: drivers/crypto/chelsio/chcr_ipsec.c:374:9: warning: T

[PATCH] PKCS#7: fix unitialized boolean 'want'

2016-02-27 Thread Colin King
From: Colin Ian King The boolean want is not initialized and hence garbage. The default should be false (later it is only set to true on tne sinfo->authattrs check). Found with static analysis using CoverityScan Signed-off-by: Colin Ian King --- crypto/asymmetric_keys/pkcs7_parser.c | 2 +- 1

[PATCH] PKCS#7: fix missing break on OID_sha224 case

2016-03-19 Thread Colin King
From: Colin Ian King The OID_sha224 case is missing a break and it falls through to the -ENOPKG error default. Since HASH_ALGO_SHA224 seems to be supported, this looks like an unintentional missing break. Fixes: 07f081fb5057 ("PKCS#7: Add OIDs for sha224, sha284 and sha512 hash algos and use t

[PATCH] s390/crypto: initialize ret to zero to avoid returning garbage value

2016-09-05 Thread Colin King
From: Colin Ian King static analysis with cppcheck detected that ret is not initialized and hence garbage is potentially being returned in the case where prng_data->ppnows.reseed_counter <= prng_reseed_limit. Signed-off-by: Colin Ian King --- arch/s390/crypto/prng.c | 2 +- 1 file changed, 1 i

[PATCH][V2] s390/crypto: initialize ret to nbytes to avoid returning garbage value

2016-09-06 Thread Colin King
From: Colin Ian King Static analysis with cppcheck detected that ret is not initialized and hence garbage is potentially being returned in the case where prng_data->ppnows.reseed_counter <= prng_reseed_limit. Thanks to Martin Schwidefsky for spotting a mistake in my original fix. Fixes: 0177db0

[PATCH] crypto: fix spelling mistake in dev_err error message

2015-08-02 Thread Colin King
From: Colin Ian King Trival change, fix spelling mistake 'aquire' -> 'acquire' in dev_err message. Signed-off-by: Colin Ian King --- drivers/crypto/img-hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/img-hash.c b/drivers/crypto/img-hash.c index ad47d0d

[PATCH] crypto: crypto4xx: rename ce_ring_contol to ce_ring_control

2017-04-21 Thread Colin King
From: Colin Ian King trivial spelling mistake, missing r, rename to ce_ring_control Signed-off-by: Colin Ian King --- drivers/crypto/amcc/crypto4xx_core.c| 2 +- drivers/crypto/amcc/crypto4xx_reg_def.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/am

[PATCH] crypto: glue_helper: remove redundant check on nbytes < bsize

2017-05-10 Thread Colin King
From: Colin Ian King There is a check to see if nbytes < bsize (and a jump to label 'done' if it is true) inside the proceeding do-while loop so it is impossible for the second nbytes < bsize check to be true, hence is it redundant and can be removed. Remove it. Detected by CoverityScan, CID#712

[PATCH] taging: ccree: fix spelling mistake: "chanined" -> "chained"

2017-06-03 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in SSI_LOG_ERR message Signed-off-by: Colin Ian King --- drivers/staging/ccree/ssi_buffer_mgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ccree/ssi_buffer_mgr.c b/drivers/staging/ccree/ssi_buffer_mg

[PATCH][V2] staging: ccree: fix spelling mistake: "chanined" -> "chained"

2017-06-03 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in SSI_LOG_ERR message Signed-off-by: Colin Ian King --- drivers/staging/ccree/ssi_buffer_mgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ccree/ssi_buffer_mgr.c b/drivers/staging/ccree/ssi_buffer_mg

[PATCH] crypto: brcm: fix spelling mistake: "fallbck" -> "fallback"

2017-06-04 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in flow_log message Signed-off-by: Colin Ian King --- drivers/crypto/bcm/cipher.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/bcm/cipher.c b/drivers/crypto/bcm/cipher.c index 61393dc70b0b..9cfd36c1bcb6

[PATCH][crypto-next] crypto: omap-aes: fix spelling mistake "Encryptio" -> "Encryption"

2017-06-13 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in pr_err message Signed-off-by: Colin Ian King --- drivers/crypto/omap-aes-gcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/omap-aes-gcm.c b/drivers/crypto/omap-aes-gcm.c index 521a310ea699..7d4f8a4be

[PATCH][crypto-next] crypto: cavium: fix spelling mistake "Revsion" -> "Revision"

2017-06-13 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in seq_printf message Signed-off-by: Colin Ian King --- drivers/crypto/cavium/nitrox/nitrox_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/cavium/nitrox/nitrox_main.c b/drivers/crypto/cavium/nitrox

[PATCH] crypto: cavium: make several functions static

2017-06-20 Thread Colin King
From: Colin Ian King The functions cvm_encrypt, cvm_decrypt, cvm_xts_setkey and cvm_enc_dec_init does not need to be in global scope, so make them static. Signed-off-by: Colin Ian King --- drivers/crypto/cavium/cpt/cptvf_algs.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) dif

[PATCH] crypto: qat: fix spelling mistake: "runing" -> "running"

2017-06-26 Thread Colin King
From: Colin Ian King trivial fix to spelling mistake in dev_info message Signed-off-by: Colin Ian King --- drivers/crypto/qat/qat_common/adf_aer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/qat/qat_common/adf_aer.c b/drivers/crypto/qat/qat_common/adf_ae

[PATCH] Crypto: atmel-ecc: Make a couple of local functions static

2017-07-19 Thread Colin King
From: Colin Ian King Functions atmel_ecc_i2c_client_alloc and atmel_ecc_i2c_client_free are local to the source and no not need to be in the global scope. Make them static. Cleans up sparse warnings: symbol 'atmel_ecc_i2c_client_alloc' was not declared. Should it be static? symbol 'atmel_ecc_i2c

[PATCH] crypto: xts: use memmove to avoid overlapped memory copy

2020-07-16 Thread Colin King
From: Colin Ian King There is a memcpy that performs a potential overlapped memory copy from source b to destination b + 1. Fix this by using the safer memmove instead. Addresses-Coverity: ("Overlapping buffer in memory copy") Fixes: 8083b1bf8163 ("crypto: xts - add support for ciphertext steal

[PATCH] hwrng: core: remove redundant initialization of variable ret

2020-07-24 Thread Colin King
From: Colin Ian King The variable ret is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/char/hw_random/core.c |

[PATCH] crypto/chcr: fix minor indentation issue

2020-09-18 Thread Colin King
From: Colin Ian King There is a statement that is indented by one whitespace too deeply, fix this by removing the whitespace. Signed-off-by: Colin Ian King --- drivers/crypto/chelsio/chcr_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/chelsio/chcr_cor

[PATCH][next] crypto: sun8i-ss@: fix memory leak on pointer d

2020-09-29 Thread Colin King
From: Colin Ian King Currently the error return path on a failed dma_mapping_error call is not kfree'ing memory allocated to d. Add an extra error exit label to end of the function where the kfree and return occurs to fix this issue. Addresses-Coverity: ("Resource leak") Fixes: ac2614d721de ("cr

[PATCH][next][resend] lib/mpi: fix off-by-one check on index "no"

2020-09-30 Thread Colin King
From: Colin Ian King There is an off-by-one range check on the upper limit of index "no". Fix this by changing the > comparison to >= Addresses-Coverity: ("Out-of-bounds read") Fixes: a8ea8bdd9df9 ("lib/mpi: Extend the MPI library") Signed-off-by: Colin Ian King --- resend to Cc linux-crypto

[PATCH] crypto: inside-secure: Fix sizeof() mismatch

2020-10-10 Thread Colin King
From: Colin Ian King An incorrect sizeof() is being used, sizeof(priv->ring[i].rdr_req) is not correct, it should be sizeof(*priv->ring[i].rdr_req). Note that since the size of ** is the same size as * this is not causing any issues. Addresses-Coverity: ("Sizeof not portable (SIZEOF_MISMATCH)")

[PATCH][next] crypto: inside-secure: fix spelling mistake "algorithmn" -> "algorithm"

2019-10-08 Thread Colin King
From: Colin Ian King There is a spelling mistake in a dev_err message. Fix it. Signed-off-by: Colin Ian King --- drivers/crypto/inside-secure/safexcel_cipher.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/inside-secure/safexcel_cipher.c b/drivers/crypto/i

[PATCH][V2][next] crypto: inside-secure: fix spelling mistake "algorithmn" -> "algorithm"

2019-10-08 Thread Colin King
From: Colin Ian King There is a spelling mistake in a dev_err message. Fix it. Add in missing newline. Signed-off-by: Colin Ian King --- V2: Add in newline \n --- drivers/crypto/inside-secure/safexcel_cipher.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto

[PATCH] crypto: mediatek: remove redundant bitwise-or

2019-10-23 Thread Colin King
From: Colin Ian King Bitwise-or'ing 0x with the u32 variable ctr is the same result as assigning the value to ctr. Remove the redundant bitwise-or and just use an assignment. Addresses-Coverity: ("Suspicious &= or |= constant expression") Signed-off-by: Colin Ian King --- drivers/cryp

[PATCH] crypto: chelsio: remove redundant premature assignment to iv

2020-05-27 Thread Colin King
From: Colin Ian King Variable iv is being assigned twice with the same value, the first assignment is redundant and can be removed and instead keep the latter assignment of iv as it is closer to the point it is being used. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King ---

[PATCH] crypto: caam/qi2: remove redundant assignment to ret

2020-06-11 Thread Colin King
From: Colin Ian King The variable ret is being assigned a value that is never read, the error exit path via label 'unmap' returns -ENOMEM anyhow, so assigning ret with -ENOMEM is redundamt. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/crypto/caam/caamalg_qi2.c

[PATCH] crypto: ccp: remove redundant assignment to variable ret

2020-06-18 Thread Colin King
From: Colin Ian King The variable ret is being assigned with a value that is never read and it is being updated later with a new value. The assignment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/crypto/ccp/ccp-ops.c | 1 - 1

[PATCH] crypto: img-hash: remove redundant initialization of variable err

2020-06-18 Thread Colin King
From: Colin Ian King The variable err is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/crypto/img-hash.c | 2 +

[PATCH][crypto-next] crypto: tcrypt: fix spelling mistake: "bufufer"-> "buffer"

2018-01-02 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistakes in pr_err error message text. Signed-off-by: Colin Ian King --- crypto/tcrypt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c index 58e3344d7169..f61d2f40dd90 100644 --- a/crypto/t

[PATCH][crypto-next] crypto: inside-secure - make function safexcel_try_push_requests static

2018-01-02 Thread Colin King
From: Colin Ian King The function safexcel_try_push_requests is local to the source and does not need to be in global scope, so make it static. Cleans up sparse warning: symbol 'safexcel_try_push_requests' was not declared. Should it be static? Signed-off-by: Colin Ian King --- drivers/crypt

[PATCH] crypto: tcrypt - free xoutbuf instead of axbuf

2018-01-02 Thread Colin King
From: Colin Ian King There seems to be a cut-n-paste bug with the name of the buffer being free'd, xoutbuf should be used instead of axbuf. Detected by CoverityScan, CID#1463420 ("Copy-paste error") Fixes: 427988d981c4 ("crypto: tcrypt - add multibuf aead speed test") Signed-off-by: Colin Ian K

[PATCH][next] staging: ccree: fix memory leaks in cc_ivgen_init

2018-01-12 Thread Colin King
From: Colin Ian King The current error exit path in function cc_ivgen_init via label 'out' free's resources from the drvdata->ivgen_handle context. However, drvdata->ivgen_handle has not been assigned to the context ivgen_ctx at this point, so the resources are not freed. Fix this by setting drvd

[PATCH][next] hwrng: exynos: check for -ve error return from readl_poll_timeout

2018-01-12 Thread Colin King
From: Colin Ian King Currently, the return from readl_poll_timeout is being assigned to a u32 and this is being checked for a -ve return which is always false since a u32 cannot be less than zero. Fix this by changing val to an int so that error returns can be correctly detected. Detected by Co

[PATCH] crypto: chelsio - Make function aead_ccm_validate_input static

2018-02-06 Thread Colin King
From: Colin Ian King Function aead_ccm_validate_input is local to the source and does not need to be in global scope, so make it static. Cleans up sparse warning: drivers/crypto/chelsio/chcr_algo.c:2627:5: warning: symbol 'aead_ccm_validate_input' was not declared. Should it be static? Signed-o

[PATCH] crypto: ccp - Make function ccp_get_dma_chan_attr static

2018-02-06 Thread Colin King
From: Colin Ian King Function ccp_get_dma_chan_attr is local to the source and does not need to be in global scope, so make it static. Cleans up sparse warning: drivers/crypto/ccp/ccp-dmaengine.c:41:14: warning: symbol 'ccp_get_dma_chan_attr' was not declared. Should it be static? Signed-off-by

[PATCH] crypto: qat - Make several functions static

2018-02-06 Thread Colin King
From: Colin Ian King Functions qat_rsa_set_n, qat_rsa_set_e and qat_rsa_set_n are local to the source and do not need to be in global scope, so make them static. Cleans up sparse warnings: drivers/crypto/qat/qat_common/qat_asym_algs.c:972:5: warning: symbol 'qat_rsa_set_n' was not declared. Shou

[PATCH] hwrng: cavium: make two functions static

2018-02-26 Thread Colin King
From: Colin Ian King Functions cavium_rng_remove and cavium_rng_remove_vf are local to the source and do not need to be in global scope, so make them static. Cleans up sparse warnings: drivers/char/hw_random/cavium-rng-vf.c:80:7: warning: symbol 'cavium_rng_remove_vf' was not declared. Should it

[PATCH][next] crypto: x86/des3_ede: make array des3_ede_skciphers static

2018-03-05 Thread Colin King
From: Colin Ian King The array des3_ede_skciphers is local to the source and does not need to be in global scope, so make it static. Cleans up sparse warning: arch/x86/crypto/des3_ede_glue.c:407:21: warning: symbol 'des3_ede_skciphers' was not declared. Should it be static? Signed-off-by: Colin

[PATCH][next] crypto: chtls: don't leak information from the stack to userspace

2018-04-05 Thread Colin King
From: Colin Ian King The structure crypto_info contains fields that are not initialized and only .version is set. The copy_to_user call is hence leaking information from the stack to userspace which must be avoided. Fix this by zero'ing all the unused fields. Detected by CoverityScan, CID#14674

[PATCH][next] crypto: chtls: remove redundant assignment to cdev->ports

2018-04-06 Thread Colin King
From: Colin Ian King There is a double assignment to cdev->ports, the first is redundant as it is over-written so remove it. Detected by CoverityScan, CID#1467432 ("Unused value") Signed-off-by: Colin Ian King --- drivers/crypto/chelsio/chtls/chtls_main.c | 1 - 1 file changed, 1 deletion(-)

[PATCH] crypto: ghash-clmulni: fix spelling mistake: "acclerated" -> "accelerated"

2018-04-27 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in module description text Signed-off-by: Colin Ian King --- arch/x86/crypto/ghash-clmulni-intel_glue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/crypto/ghash-clmulni-intel_glue.c b/arch/x86/crypto/ghash-c

[PATCH] hwrng: n2: fix spelling mistake: "restesting" -> "retesting"

2018-05-08 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in dev_err error message Signed-off-by: Colin Ian King --- drivers/char/hw_random/n2-drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/hw_random/n2-drv.c b/drivers/char/hw_random/n2-drv.c index 92dd4e9253

[PATCH] crypto: nx: fix spelling mistake: "seqeunce" -> "sequence"

2018-05-09 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in CSB_ERR error message text Signed-off-by: Colin Ian King --- drivers/crypto/nx/nx-842-powernv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/nx/nx-842-powernv.c b/drivers/crypto/nx/nx-842-powernv.c i

[PATCH][next] crypto: ccree - fix spelling mistake "configration" -> "configuration"

2019-07-01 Thread Colin King
From: Colin Ian King There is a spelling mistake in a dev_err message. Fix it. Signed-off-by: Colin Ian King --- drivers/crypto/ccree/cc_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/ccree/cc_driver.c b/drivers/crypto/ccree/cc_driver.c index 980aa0

[PATCH] crypto: fix a couple of spelling mistakes in Kconfig files

2020-11-14 Thread Colin King
From: Colin Ian King There are a couple of spelling mistakes in two crypto Kconfig files. Fix these. Signed-off-by: Colin Ian King --- drivers/crypto/Kconfig | 2 +- drivers/crypto/allwinner/Kconfig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto

[PATCH] crypto: sun8i-ss: Fix memory leak of object d when dma_iv fails to map

2021-03-02 Thread Colin King
From: Colin Ian King In the case where the dma_iv mapping fails, the return error path leaks the memory allocated to object d. Fix this by adding a new error return label and jumping to this to ensure d is free'd before the return. Addresses-Coverity: ("Resource leak") Fixes: ac2614d721de ("cry

[PATCH][V2] crypto: sa2ul: Fix memory leak of rxd

2021-04-01 Thread Colin King
From: Colin Ian King There are two error return paths that are not freeing rxd and causing memory leaks. Fix these. Addresses-Coverity: ("Resource leak") Fixes: 00c9211f60db ("crypto: sa2ul - Fix DMA mapping API usage") Signed-off-by: Colin Ian King --- V2: Fix typo in $SUBJECT --- drivers/

[PATCH] crypto: sa2ul: Fix memory lead of rxd

2021-04-01 Thread Colin King
From: Colin Ian King There are two error return paths that are not freeing rxd and causing memory leaks. Fix these. Addresses-Coverity: ("Resource leak") Fixes: 00c9211f60db ("crypto: sa2ul - Fix DMA mapping API usage") Signed-off-by: Colin Ian King --- drivers/crypto/sa2ul.c | 8 ++-- 1

[PATCH][next] crypto: sun8i-ss: Fix memory leak of pad

2021-04-01 Thread Colin King
From: Colin Ian King It appears there are several failure return paths that don't seem to be free'ing pad. Fix these. Addresses-Coverity: ("Resource leak") Fixes: d9b45418a917 ("crypto: sun8i-ss - support hash algorithms") Signed-off-by: Colin Ian King --- drivers/crypto/allwinner/sun8i-ss/sun

[PATCH] crypto: zip: make several functions static

2018-06-30 Thread Colin King
From: Colin Ian King The functions zip_ctx_exit, zip_compress, zip_decompress and zip_ctx_init are local to the source and do not need to be in global scope, so make them static. Cleans up sparse warnings: symbol 'zip_ctx_exit' was not declared. Should it be static? symbol 'zip_compress' was not

[PATCH][RESEND] lib/mpi: remove redundant variable esign

2018-07-30 Thread Colin King
From: Colin Ian King Variable esign is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'esign' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King --- lib/mpi/mpi-pow.c | 3 +-- 1 file changed, 1 inse

[PATCH] pcrypt: use format specifier in kobject_add

2018-10-27 Thread Colin King
From: Colin Ian King Passing string 'name' as the format specifier is potentially hazardous because name could (although very unlikely to) have a format specifier embedded in it causing issues when parsing the non-existent arguments to these. Follow best practice by using the "%s" format string

[PATCH] crypto: chelsio: clean up various indentation issues

2018-10-30 Thread Colin King
From: Colin Ian King Trivial fix to clean up varous indentation issue Signed-off-by: Colin Ian King --- drivers/crypto/chelsio/chcr_algo.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/crypto/chelsio/chcr_algo.c b/drivers/crypto/chelsio/chcr_algo

[PATCH] padata: clean an indentation issue, remove extraneous space

2018-11-09 Thread Colin King
From: Colin Ian King Trivial fix to clean up an indentation issue Signed-off-by: Colin Ian King --- kernel/padata.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/padata.c b/kernel/padata.c index d568cc56405f..3e2633ae3bca 100644 --- a/kernel/padata.c +++ b/kernel/p

[PATCH] crypto: virtio: clean up indentation, replace spaces with tab

2018-12-30 Thread Colin King
From: Colin Ian King A statement is indented with spaces and not indented enough, fix this replacing spaces with a tab. Signed-off-by: Colin Ian King --- drivers/crypto/virtio/virtio_crypto_algs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/virtio/virtio_