Skip to contentSkip to conversation

drm/etnaviv: fix missing unlock on error in etnaviv_gpu_submit()

PATCH In review Wei Yongjun 2 participants 2 messages Apr 12, 2017

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

PATCH 1/1 drm/etnaviv: fix missing unlock on error in etnaviv_gpu_submit()

From: Wei Yongjun <[email protected]>

Add the missing unlock before return from function etnaviv_gpu_submit() in the error handling case.

Fixes f3cd1b064f11 ("drm/etnaviv: (re-)protect fence allocation with

GPU mutex")

---
 drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/etnaviv/etnaviv_gpu.c +2 -1
index da48819..e4a4d4c 100644
@@ -1317,7 +1317,7 @@ int etnaviv_gpu_submit(struct etnaviv_gpu *gpu,
 	if (!fence) {
 		event_free(gpu, event);
 		ret = -ENOMEM;
-		goto out_pm_put;
+		goto out_unlok;
 	}
 
 	gpu->event[event].fence = fence;
@@ -1357,6 +1357,7 @@ int etnaviv_gpu_submit(struct etnaviv_gpu *gpu,
 	hangcheck_timer_reset(gpu);
 	ret = 0;
 
+out_unlok:
 	mutex_unlock(&gpu->lock);
 
 out_pm_put:
maintainer
#1 lore raw

Am Mittwoch, den 12.04.2017, 00:31 +0000 schrieb Wei Yongjun:

Quoted 17 lines

From: Wei Yongjun <[email protected]>

Add the missing unlock before return from function etnaviv_gpu_submit() in the error handling case.

Fixes f3cd1b064f11 ("drm/etnaviv: (re-)protect fence allocation with

GPU mutex")

---
 drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/etnaviv/etnaviv_gpu.c +0 -0
index da48819..e4a4d4c 100644

drivers/gpu/drm/etnaviv/etnaviv_gpu.c int etnaviv_gpu_submit(struct etnaviv_gpu *gpu, · line 1320

Quoted 5 lines
drivers/gpu/drm/etnaviv/etnaviv_gpu.c +1 -1
@@ -1317,7 +1317,7 @@ int etnaviv_gpu_submit(struct etnaviv_gpu *gpu,
 	if (!fence) {
 		event_free(gpu, event);
 		ret = -ENOMEM;
-		goto out_pm_put;
+		goto out_unlok;

Label should probably be named "out_unlock". Fixed up while applying, thanks.

Regards,
Lucas

drivers/gpu/drm/etnaviv/etnaviv_gpu.c int etnaviv_gpu_submit(struct etnaviv_gpu *gpu, · line 1363

Quoted 12 lines
drivers/gpu/drm/etnaviv/etnaviv_gpu.c +1 -0
 	}
 
 	gpu->event[event].fence = fence;
@@ -1357,6 +1357,7 @@ int etnaviv_gpu_submit(struct etnaviv_gpu *gpu,
 	hangcheck_timer_reset(gpu);
 	ret = 0;
 
+out_unlok:
 	mutex_unlock(&gpu->lock);
 
 out_pm_put:

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