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

Commit c0b3e6f0 authored by Mansur Alisha Shaik's avatar Mansur Alisha Shaik Committed by Gerrit - the friendly Code Review server
Browse files

msm: vidc_3x: Fix for KW warnings.



temp_ctrl may explicitly dereference NULL value
returned by get_ctrl_from_cluster.
So added NULL check to avoid runtime errors.

Array elements not initialized, which can cause
security implications.
So initialized array elements.

Change-Id: I93457db1707fffe1e47b27890e83e5b8cd513aef
Signed-off-by: default avatarMansur Alisha Shaik <mansur@codeaurora.org>
parent 61147a12
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -2327,6 +2327,11 @@ static int msm_venc_validate_qp_value(struct msm_vidc_inst *inst,
		}
		max = temp_ctrl->maximum;
		temp_ctrl = TRY_GET_CTRL(V4L2_CID_MPEG_VIDEO_VPX_MIN_QP);
		if (!temp_ctrl) {
			dprintk(VIDC_ERR,
				"failed to get control");
			return -EINVAL;
		}
		min = temp_ctrl->minimum;
		if (!VALIDATE_BOUNDARIES(min, max, qp_value))
			rc = -EINVAL;
@@ -2341,6 +2346,11 @@ static int msm_venc_validate_qp_value(struct msm_vidc_inst *inst,
		}
		max = temp_ctrl->maximum;
		temp_ctrl = TRY_GET_CTRL(V4L2_CID_MPEG_VIDEO_MPEG4_MIN_QP);
		if (!temp_ctrl) {
			dprintk(VIDC_ERR,
				"failed to get control");
			return -EINVAL;
		}
		min = temp_ctrl->minimum;
		if (!VALIDATE_BOUNDARIES(min, max, qp_value))
			rc = -EINVAL;
@@ -2355,6 +2365,11 @@ static int msm_venc_validate_qp_value(struct msm_vidc_inst *inst,
		}
		max = temp_ctrl->maximum;
		temp_ctrl = TRY_GET_CTRL(V4L2_CID_MPEG_VIDEO_H264_MIN_QP);
		if (!temp_ctrl) {
			dprintk(VIDC_ERR,
				"failed to get control");
			return -EINVAL;
		}
		min = temp_ctrl->minimum;
		if (!VALIDATE_BOUNDARIES(min, max, qp_value))
			rc = -EINVAL;
+1 −1
Original line number Diff line number Diff line
@@ -4446,7 +4446,7 @@ static int venus_hfi_get_fw_info(void *dev, struct hal_fw_info *fw_info)
	struct venus_hfi_device *device = dev;
	u32 smem_block_size = 0;
	u8 *smem_table_ptr;
	char version[VENUS_VERSION_LENGTH];
	char version[VENUS_VERSION_LENGTH] = "";
	const u32 smem_image_index_venus = 14 * 128;

	if (!device || !fw_info) {