diff --git a/crypto-qti/qce50.c b/crypto-qti/qce50.c index bf1a37cd08..ed0dca216d 100644 --- a/crypto-qti/qce50.c +++ b/crypto-qti/qce50.c @@ -6278,10 +6278,8 @@ static int __qce_get_device_tree_data(struct platform_device *pdev, goto err_getting_bam_info; } - resource = platform_get_resource(pdev, IORESOURCE_IRQ, 0); - if (resource) { - pce_dev->ce_bam_info.bam_irq = resource->start; - } else { + pce_dev->ce_bam_info.bam_irq = platform_get_irq(pdev,0); + if (pce_dev->ce_bam_info.bam_irq < 0) { pr_err("CRYPTO BAM IRQ unavailable.\n"); goto err_dev; } diff --git a/crypto-qti/qcedev.c b/crypto-qti/qcedev.c index d53e512aeb..3f9897187e 100644 --- a/crypto-qti/qcedev.c +++ b/crypto-qti/qcedev.c @@ -2256,7 +2256,7 @@ long qcedev_ioctl(struct file *file, err = -ENOTTY; goto exit_free_qcedev_areq; } - /* Fall-through */ + fallthrough; case QCEDEV_IOCTL_SHA_UPDATE_REQ: { struct scatterlist sg_src; @@ -2842,6 +2842,6 @@ static void qcedev_exit(void) MODULE_LICENSE("GPL v2"); MODULE_DESCRIPTION("QTI DEV Crypto driver"); - +MODULE_IMPORT_NS(DMA_BUF); module_init(qcedev_init); module_exit(qcedev_exit); diff --git a/crypto-qti/qcrypto.c b/crypto-qti/qcrypto.c index d13e179080..402cac78c6 100644 --- a/crypto-qti/qcrypto.c +++ b/crypto-qti/qcrypto.c @@ -1388,6 +1388,8 @@ static int _qcrypto_check_aes_keylen(struct crypto_priv *cp, unsigned int len) case AES_KEYSIZE_192: if (cp->ce_support.aes_key_192) break; + else + return -EINVAL; default: //crypto_ablkcipher_set_flags(cipher, CRYPTO_TFM_RES_BAD_KEY_LEN); return -EINVAL; @@ -3078,8 +3080,13 @@ static int _qcrypto_aead_ccm_setkey(struct crypto_aead *aead, const u8 *key, case AES_KEYSIZE_256: break; case AES_KEYSIZE_192: - if (cp->ce_support.aes_key_192) + if (cp->ce_support.aes_key_192) { break; + } + else { + ctx->enc_key_len = 0; + return -EINVAL; + } default: ctx->enc_key_len = 0; //crypto_aead_set_flags(aead, CRYPTO_TFM_RES_BAD_KEY_LEN); diff --git a/hdcp/hdcp_qseecom.c b/hdcp/hdcp_qseecom.c index a3f8ebf2fb..6ed988d91c 100644 --- a/hdcp/hdcp_qseecom.c +++ b/hdcp/hdcp_qseecom.c @@ -1272,8 +1272,10 @@ int hdcp2_app_comm(void *ctx, enum hdcp2_app_cmd cmd, break; case HDCP2_CMD_STOP: rc = hdcp2_app_stop(handle); + break; default: - goto error; + rc = -EINVAL; + break; } if (rc) diff --git a/smcinvoke/smcinvoke.c b/smcinvoke/smcinvoke.c index 46e3a5a19f..5aca50b447 100644 --- a/smcinvoke/smcinvoke.c +++ b/smcinvoke/smcinvoke.c @@ -882,14 +882,13 @@ static struct smcinvoke_cb_txn *find_cbtxn_locked( } /* - * size_add saturates at SIZE_MAX. If integer overflow is detected, + * size_add_ saturates at SIZE_MAX. If integer overflow is detected, * this function would return SIZE_MAX otherwise normal a+b is returned. */ -static inline size_t size_add(size_t a, size_t b) +static inline size_t size_add_(size_t a, size_t b) { return (b > (SIZE_MAX - a)) ? SIZE_MAX : a + b; } - /* * pad_size is used along with size_align to define a buffer overflow * protected version of ALIGN @@ -905,7 +904,7 @@ static inline size_t pad_size(size_t a, size_t b) */ static inline size_t size_align(size_t a, size_t b) { - return size_add(a, pad_size(a, b)); + return size_add_(a, pad_size(a, b)); } static uint16_t get_server_id(int cb_server_fd) @@ -1729,7 +1728,7 @@ static size_t compute_in_msg_size(const struct smcinvoke_cmd_req *req, /* each buffer has to be 8 bytes aligned */ while (i < OBJECT_COUNTS_NUM_buffers(req->counts)) - total_size = size_add(total_size, + total_size = size_add_(total_size, size_align(args_buf[i++].b.size, SMCINVOKE_ARGS_ALIGN_SIZE)); @@ -2802,3 +2801,4 @@ module_exit(smcinvoke_exit); MODULE_LICENSE("GPL v2"); MODULE_DESCRIPTION("SMC Invoke driver"); MODULE_IMPORT_NS(VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver); +MODULE_IMPORT_NS(DMA_BUF); diff --git a/tz_log/tz_log.c b/tz_log/tz_log.c index 411104d2eb..ab6296d41a 100644 --- a/tz_log/tz_log.c +++ b/tz_log/tz_log.c @@ -1304,7 +1304,7 @@ static ssize_t tzdbg_fs_read(struct file *file, char __user *buf, static int tzdbg_procfs_open(struct inode *inode, struct file *file) { - return single_open(file, NULL, PDE_DATA(inode)); + return single_open(file, NULL, pde_data(inode)); } static int tzdbg_procfs_release(struct inode *inode, struct file *file)