From: Thomas Schwinge Date: Sat, 23 May 2020 15:20:30 +0000 (+0200) Subject: [OpenACC] Missing unlocking on error paths in attach/detach code, part II X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2e24d457d8c97e409549848715ff046cfa9efd3d;p=gcc.git [OpenACC] Missing unlocking on error paths in attach/detach code, part II libgomp/ * oacc-mem.c (goacc_exit_data_internal): Unlock on error path. --- 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); }