[OpenACC] Missing unlocking on error paths in attach/detach code, part II
authorThomas Schwinge <thomas@codesourcery.com>
Sat, 23 May 2020 15:20:30 +0000 (17:20 +0200)
committerThomas Schwinge <thomas@codesourcery.com>
Thu, 4 Jun 2020 16:56:37 +0000 (18:56 +0200)
libgomp/
* oacc-mem.c (goacc_exit_data_internal): Unlock on error path.

libgomp/oacc-mem.c

index c06b7341cbbf1501e9d2fc7a615d6204a8f42cac..6713846c942919af6779010c662c1efceddc1372 100644 (file)
@@ -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);
          }