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

Commit 5ea1ec83 authored by Vishalsingh Hajeri's avatar Vishalsingh Hajeri Committed by Gerrit - the friendly Code Review server
Browse files

msm: camera: context: Add null check on context pointer



Check for context pointer being null, before accessing its
members.

Change-Id: I778c44e743edddcddf0f2fd6fd49336dfe00baf0
Signed-off-by: default avatarVishalsingh Hajeri <vhajeri@codeaurora.org>
parent a61fdbf7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -357,7 +357,7 @@ int cam_context_handle_start_dev(struct cam_context *ctx,
{
	int rc = 0;

	if (!ctx->state_machine) {
	if (!ctx || !ctx->state_machine) {
		CAM_ERR(CAM_CORE, "Context is not ready");
		return -EINVAL;
	}
@@ -386,7 +386,7 @@ int cam_context_handle_stop_dev(struct cam_context *ctx,
{
	int rc = 0;

	if (!ctx->state_machine) {
	if (!ctx || !ctx->state_machine) {
		CAM_ERR(CAM_CORE, "Context is not ready");
		return -EINVAL;
	}