[COMMON] samsung: exynos-dm: fix the mutex unlocking
authorTaekki Kim <taekki.kim@samsung.com>
Tue, 20 Sep 2016 12:22:14 +0000 (21:22 +0900)
committerChungwoo Park <cww.park@samsung.com>
Mon, 21 May 2018 08:26:04 +0000 (17:26 +0900)
This patch fixes the mutex unlocking when return from error.

Change-Id: I5c5e97446535432e5ff2a3503649fac216a2d851
Signed-off-by: Taekki Kim <taekki.kim@samsung.com>
drivers/soc/samsung/exynos-dm.c

index dacd8fc2955d4011eceb3fcf0779c873fcda619a..6bcdf0ee0541555bd982232fac3fd15e4a13aa29 100644 (file)
@@ -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;
        }