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

Commit 31f1acd9 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: vidc: Add check to avoid NULL ptr dereference"

parents 550bffc0 a57153a3
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -1390,6 +1390,7 @@ static int msm_vidc_op_s_ctrl(struct v4l2_ctrl *ctrl)
	int rc = 0;
	unsigned int c = 0;
	struct msm_vidc_inst *inst;
	const char *ctrl_name = NULL;

	if (!ctrl) {
		dprintk(VIDC_ERR, "%s invalid parameters for ctrl\n", __func__);
@@ -1413,9 +1414,12 @@ static int msm_vidc_op_s_ctrl(struct v4l2_ctrl *ctrl)
			}
		}
	}
	if (rc)
	if (rc) {
		ctrl_name = v4l2_ctrl_get_name(ctrl->id);
		dprintk(VIDC_ERR, "Failed setting control: Inst = %pK (%s)\n",
				inst, v4l2_ctrl_get_name(ctrl->id));
			inst, ctrl_name ? ctrl_name : "Invalid ctrl");
	}

	return rc;
}