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

Commit b5215017 authored by Jeyaprakash Soundrapandian's avatar Jeyaprakash Soundrapandian Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: camera: fd: Add mutex protection to frame done processing" into dev/msm-4.14-camx

parents ba7b8c34 b4d1047b
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -427,6 +427,7 @@ static int cam_fd_hw_util_processcmd_frame_done(struct cam_hw_info *fd_hw,
	unsigned long flags;
	int i;

	mutex_lock(&fd_hw->hw_mutex);
	spin_lock_irqsave(&fd_core->spin_lock, flags);
	if ((fd_core->core_state != CAM_FD_CORE_STATE_IDLE) ||
		(fd_core->results_valid == false) ||
@@ -436,6 +437,7 @@ static int cam_fd_hw_util_processcmd_frame_done(struct cam_hw_info *fd_hw,
			fd_core->core_state, fd_core->results_valid,
			fd_core->hw_req_private);
		spin_unlock_irqrestore(&fd_core->spin_lock, flags);
		mutex_unlock(&fd_hw->hw_mutex);
		return -EINVAL;
	}
	fd_core->core_state = CAM_FD_CORE_STATE_READING_RESULTS;
@@ -516,6 +518,7 @@ static int cam_fd_hw_util_processcmd_frame_done(struct cam_hw_info *fd_hw,
	fd_core->hw_req_private = NULL;
	fd_core->core_state = CAM_FD_CORE_STATE_IDLE;
	spin_unlock_irqrestore(&fd_core->spin_lock, flags);
	mutex_unlock(&fd_hw->hw_mutex);

	return 0;
}