Skip to contentSkip to conversation

drm: msm: dsi: Added missing mutex_unlock

PATCH In review Saurabh Sengar 2 participants 2 messages Dec 6, 2015 – Dec 7, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm: msm: dsi: Added missing mutex_unlock

in case of failed to get iova, function was returning without releasing the mutex. Added it.

---
 drivers/gpu/drm/msm/dsi/dsi_host.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/msm/dsi/dsi_host.c +1 -1
index 4c49868..13f937b 100644
@@ -849,11 +849,11 @@ static int dsi_tx_buf_alloc(struct msm_dsi_host *msm_host, int size)
 	}
 
 	ret = msm_gem_get_iova_locked(msm_host->tx_gem_obj, 0, &iova);
+	mutex_unlock(&dev->struct_mutex);
 	if (ret) {
 		pr_err("%s: failed to get iova, %d\n", __func__, ret);
 		return ret;
 	}
-	mutex_unlock(&dev->struct_mutex);
 
 	if (iova & 0x07) {
 		pr_err("%s: buf NOT 8 bytes aligned\n", __func__);
Signature · 1 line
1.9.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Saurabh Sengar

in case of failed to get iova, function was returning without releasing the mutex. Added it.

Quoted 22 lines
---
 drivers/gpu/drm/msm/dsi/dsi_host.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/msm/dsi/dsi_host.c +1 -2
index 4c49868..13f937b 100644
@@ -849,11 +849,11 @@ static int dsi_tx_buf_alloc(struct msm_dsi_host *msm_host, int size)
        }
 
        ret = msm_gem_get_iova_locked(msm_host->tx_gem_obj, 0, &iova);
+       mutex_unlock(&dev->struct_mutex);
        if (ret) {
                pr_err("%s: failed to get iova, %d\n", __func__, ret);
                return ret;
        }
-       mutex_unlock(&dev->struct_mutex);
 
        if (iova & 0x07) {
                pr_err("%s: buf NOT 8 bytes aligned\n", __func__);
--
Quoted 2 lines

1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel