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

Commit a50a7b33 authored by Venkat Chinta's avatar Venkat Chinta
Browse files

msm: camera: flash: Release resources in case of error



Release mutex resource in case of apply settings or stop device
failure.

Change-Id: I89180963c455451b5245647ddcc4d41c1e2b2bb7
Signed-off-by: default avatarVenkat Chinta <vchinta@codeaurora.org>
parent 1c7f6325
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
/* Copyright (c) 2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -41,6 +41,8 @@ static int32_t cam_flash_driver_cmd(struct cam_flash_ctrl *fctrl,
			CAM_ERR(CAM_FLASH,
				"Cannot apply Acquire dev: Prev state: %d",
				fctrl->flash_state);
			rc = -EINVAL;
			goto release_mutex;
		}

		if (fctrl->bridge_intf.device_hdl != -1) {
@@ -161,6 +163,8 @@ static int32_t cam_flash_driver_cmd(struct cam_flash_ctrl *fctrl,
			CAM_WARN(CAM_FLASH,
				"Cannot apply Stop dev: Prev state is: %d",
				fctrl->flash_state);
			rc = -EINVAL;
			goto release_mutex;
		}

		rc = cam_flash_stop_dev(fctrl);