aboutsummaryrefslogtreecommitdiff
path: root/libgomp/oacc-mem.c
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2020-05-23 17:20:30 +0200
committerThomas Schwinge <thomas@codesourcery.com>2020-06-04 18:56:37 +0200
commit2e24d457d8c97e409549848715ff046cfa9efd3d (patch)
tree67eeb1d422b8e81d31cf9ac6a1418d12239ed0b8 /libgomp/oacc-mem.c
parentdc9541545d9e5705a97c41713c557f55522b54dc (diff)
[OpenACC] Missing unlocking on error paths in attach/detach code, part II
libgomp/ * oacc-mem.c (goacc_exit_data_internal): Unlock on error path.
Diffstat (limited to 'libgomp/oacc-mem.c')
-rw-r--r--libgomp/oacc-mem.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libgomp/oacc-mem.c b/libgomp/oacc-mem.c
index c06b7341cbb..6713846c942 100644
--- a/libgomp/oacc-mem.c
+++ b/libgomp/oacc-mem.c
@@ -1060,7 +1060,10 @@ goacc_exit_data_internal (struct gomp_device_descr *acc_dev, size_t mapnum,
= splay_tree_lookup (&acc_dev->mem_map, &cur_node);
if (n == NULL)
- gomp_fatal ("struct not mapped for detach operation");
+ {
+ gomp_mutex_unlock (&acc_dev->lock);
+ gomp_fatal ("struct not mapped for detach operation");
+ }
gomp_detach_pointer (acc_dev, aq, n, hostaddr, finalize, NULL);
}