crypto: rockchip: Fixed a warning found by static code scanner
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com> Change-Id: I95055ed3d767719b9b2088330f3e5646491b6894
This commit is contained in:
@@ -131,6 +131,8 @@ crypto_create_session(struct fcrypt *fcr, struct session_op *sop)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
memset(&keys, 0x00, sizeof(keys));
|
||||
|
||||
switch (sop->cipher) {
|
||||
case 0:
|
||||
break;
|
||||
|
||||
@@ -636,7 +636,7 @@ static int crypto_rsa_run(struct fcrypt *fcr, struct kernel_crypt_rsa_op *krop)
|
||||
const char *driver = "rsa-rk";
|
||||
struct crypto_akcipher *tfm = NULL;
|
||||
struct akcipher_request *req = NULL;
|
||||
struct crypto_wait wait;
|
||||
DECLARE_CRYPTO_WAIT(wait);
|
||||
struct scatterlist src, dst;
|
||||
bool is_priv_key = (rop->flags & COP_FLAG_RSA_PRIV) == COP_FLAG_RSA_PRIV;
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ int __cryptodev_get_userbuf(uint8_t __user *addr, uint32_t len, int write,
|
||||
#else
|
||||
mmap_read_unlock(mm);
|
||||
#endif
|
||||
if (ret != pgcount)
|
||||
if (ret < 0 || ret != pgcount)
|
||||
return -EINVAL;
|
||||
|
||||
sg_init_table(sg, pgcount);
|
||||
|
||||
Reference in New Issue
Block a user