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

Commit 1664c460 authored by Trishansh Bhardwaj's avatar Trishansh Bhardwaj
Browse files

msm: camera: flash: Remove race condition in subdev close



Subdev close is calling flash_shutdown() to flush req and release
device operation. flash_subdev_close() does the mutex lock already.
Removing same mutex lock opertion from flash_shutdown() function
to remove race condition.

Change-Id: Ib5fcb6f683b8c997121b3f4fb301eb34b76c2c1b
Signed-off-by: default avatarTrishansh Bhardwaj <tbhardwa@codeaurora.org>
parent a91b82ae
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -1565,9 +1565,7 @@ void cam_flash_shutdown(struct cam_flash_ctrl *fctrl)

	if ((fctrl->flash_state == CAM_FLASH_STATE_CONFIG) ||
		(fctrl->flash_state == CAM_FLASH_STATE_START)) {
		mutex_lock(&(fctrl->flash_mutex));
		fctrl->func_tbl.flush_req(fctrl, FLUSH_ALL, 0);
		mutex_unlock(&(fctrl->flash_mutex));
		rc = fctrl->func_tbl.power_ops(fctrl, false);
		if (rc)
			CAM_ERR(CAM_FLASH, "Power Down Failed rc: %d",