[PATCH] crypto: fix typo in dev_err error message

2015-02-28 Thread Colin King
From: Colin Ian King colin.k...@canonical.com Fix typo, intialization - initialization Signed-off-by: Colin Ian King colin.k...@canonical.com --- drivers/crypto/atmel-aes.c | 2 +- drivers/crypto/atmel-sha.c | 2 +- drivers/crypto/atmel-tdes.c | 2 +- 3 files changed, 3 insertions(+), 3

[PATCH] crypto: ensure backlog is initialised

2015-04-14 Thread Colin King
From: Colin Ian King colin.k...@canonical.com 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

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

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

[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

[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

[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

[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

[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 ---

[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

[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

[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 ---

[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

[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

[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

[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.

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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:

[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

[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

[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

[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:

[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:

[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 |

[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

[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

[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

[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

[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.

[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

[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

[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

[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

[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

[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.

[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

[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

[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

[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

[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")

[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

[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 ---

[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

[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'

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

2014-08-24 Thread Colin King
From: Colin Ian King colin.k...@canonical.com 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