Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e7ba166e authored by Yu SI's avatar Yu SI Committed by Gerrit - the friendly Code Review server
Browse files

msm: cvp:fix potential prop_array idx out range



fix potential issue that idx of prop_array could be out of range

Change-Id: Ia2d6a7332f66f518b2f8d96ed999e3963f1b9284
Signed-off-by: default avatarYu SI <ysi@codeaurora.org>
parent db1e19be
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1125,7 +1125,7 @@ static int msm_cvp_set_sysprop(struct msm_cvp_inst *inst,
		return -EINVAL;
	}

	if (props->prop_num >= MAX_KMD_PROP_NUM) {
	if (props->prop_num >= MAX_KMD_PROP_NUM_PER_PACKET) {
		dprintk(CVP_ERR, "Too many properties %d to set\n",
			props->prop_num);
		return -E2BIG;
+2 −1
Original line number Diff line number Diff line
@@ -149,7 +149,8 @@ struct cvp_kmd_hfi_packet {
#define CVP_KMD_PROP_PWR_DDR_OP	0x1C
#define CVP_KMD_PROP_PWR_SYSCACHE_OP	0x1D

#define MAX_KMD_PROP_NUM	(CVP_KMD_PROP_PWR_SYSCACHE_OP + 1)
#define MAX_KMD_PROP_NUM_PER_PACKET		8
#define MAX_KMD_PROP_TYPE	(CVP_KMD_PROP_PWR_SYSCACHE_OP + 1)

struct cvp_kmd_sys_property {
	__u32 prop_type;