crypto: ccp: use dma_mapping_error to check map error

2017-08-08 Thread Pan Bian
The return value of dma_map_single() should be checked by dma_mapping_error(). However, in function ccp_init_dm_workarea(), its return value is checked against NULL, which could result in failures. Signed-off-by: Pan Bian <bianpan2...@163.com> --- drivers/crypto/ccp/ccp-ops.c | 2 +-

[PATCH 1/1] crypto: asymmetric_keys: set error code on failure

2016-12-03 Thread Pan Bian
From: Pan Bian <bianpan2...@163.com> In function public_key_verify_signature(), returns variable ret on error paths. When the call to kmalloc() fails, the value of ret is 0, and it is not set to an errno before returning. This patch fixes the bug. Bugzilla: https://bugzilla.kern

[PATCH 1/1] crypto: set error code when kcalloc fails

2016-11-30 Thread Pan Bian
) even if kcalloc() fails. This patch fixes the bug by explicitly assigning -ENOMEM to err when kcalloc() returns a NULL pointer. Signed-off-by: Pan Bian <bianpan2...@163.com> --- crypto/algif_skcipher.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crypto/algif_skciph