From 2e24d457d8c97e409549848715ff046cfa9efd3d Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Sat, 23 May 2020 17:20:30 +0200 Subject: [PATCH] [OpenACC] Missing unlocking on error paths in attach/detach code, part II libgomp/ * oacc-mem.c (goacc_exit_data_internal): Unlock on error path. --- libgomp/oacc-mem.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); } -- 2.30.2