From fe26bb848b1c647e293e45c104309304f840df75 Mon Sep 17 00:00:00 2001 From: Taekki Kim Date: Tue, 20 Sep 2016 21:22:14 +0900 Subject: [PATCH] [COMMON] samsung: exynos-dm: fix the mutex unlocking This patch fixes the mutex unlocking when return from error. Change-Id: I5c5e97446535432e5ff2a3503649fac216a2d851 Signed-off-by: Taekki Kim --- drivers/soc/samsung/exynos-dm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/soc/samsung/exynos-dm.c b/drivers/soc/samsung/exynos-dm.c index dacd8fc2955d..6bcdf0ee0541 100644 --- a/drivers/soc/samsung/exynos-dm.c +++ b/drivers/soc/samsung/exynos-dm.c @@ -648,7 +648,7 @@ int policy_update_call_to_DM(enum exynos_dm_type dm_type, u32 min_freq, u32 max_ if (ret) { dev_err(exynos_dm->dev, "acpm request channel is failed, id:%u, size:%u\n", ch_num, size); - return -EINVAL; + goto out; } config.cmd = cmd; config.response = true; @@ -660,7 +660,7 @@ int policy_update_call_to_DM(enum exynos_dm_type dm_type, u32 min_freq, u32 max_ ret = acpm_ipc_send_data(ch_num, &config); if (ret) { dev_err(exynos_dm->dev, "Failed to send policy data to FVP"); - return -EINVAL; + goto out; } } #endif @@ -750,6 +750,7 @@ int DM_CALL(enum exynos_dm_type dm_type, unsigned long *target_freq) ret = dm_data_updater(dm_type); if (ret) { pr_err("Failed to update DM DATA!\n"); + mutex_unlock(&exynos_dm->lock); return -EAGAIN; } -- 2.20.1