aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libgomp/target.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libgomp/target.c b/libgomp/target.c
index 67fcf41..196dba4 100644
--- a/libgomp/target.c
+++ b/libgomp/target.c
@@ -385,7 +385,10 @@ gomp_copy_host2dev (struct gomp_device_descr *devicep,
else if (cbuf->chunks[middle].start <= doff)
{
if (doff + sz > cbuf->chunks[middle].end)
- gomp_fatal ("internal libgomp cbuf error");
+ {
+ gomp_mutex_unlock (&devicep->lock);
+ gomp_fatal ("internal libgomp cbuf error");
+ }
memcpy ((char *) cbuf->buf + (doff - cbuf->chunks[0].start),
h, sz);
return;