Commit 0463cb31 authored by JiangShui Yang's avatar JiangShui Yang Committed by JiangShui
Browse files

crypto: hisilicon/qm - add bracket protection for macro parameters

driver inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I91BV7


CVE: NA

----------------------------------------------------------------------

The macro function does not verify the parameter type. Therefore, are
added for protection.

Signed-off-by: default avatarJiangShui Yang <yangjiangshui@h-partners.com>
parent afe6e074
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -244,7 +244,7 @@
	((cqe_sz) << QM_CQ_CQE_SIZE_SHIFT))

#define QM_MK_CQC_DW3_V2(cqe_sz, cq_depth) \
	((((u32)cq_depth) - 1) | ((cqe_sz) << QM_CQ_CQE_SIZE_SHIFT))
	(((u32)(cq_depth) - 1) | ((cqe_sz) << QM_CQ_CQE_SIZE_SHIFT))

#define QM_MK_SQC_W13(priority, orders, alg_type) \
	(((priority) << QM_SQ_PRIORITY_SHIFT) | \
@@ -258,7 +258,7 @@
	((u32)ilog2(sqe_sz) << QM_SQ_SQE_SIZE_SHIFT))

#define QM_MK_SQC_DW3_V2(sqe_sz, sq_depth) \
	((((u32)sq_depth) - 1) | ((u32)ilog2(sqe_sz) << QM_SQ_SQE_SIZE_SHIFT))
	(((u32)(sq_depth) - 1) | ((u32)ilog2(sqe_sz) << QM_SQ_SQE_SIZE_SHIFT))

enum vft_type {
	SQC_VFT = 0,