vec-iree: fix buffer unmap mechanism Per https://github.com/google/iree/blob/main/iree/hal/buffer.h#L430, only mapped buffer can be unmapped. Guard it with `iree_status_is_ok` check. Change-Id: Id997798b7e26a13eef8285100c78eb24df22d59c
diff --git a/samples/simple_vec_mul/simple_vec_mul.c b/samples/simple_vec_mul/simple_vec_mul.c index 1ef2188..4bd6dc3 100644 --- a/samples/simple_vec_mul/simple_vec_mul.c +++ b/samples/simple_vec_mul/simple_vec_mul.c
@@ -139,8 +139,8 @@ } if (iree_status_is_ok(result)) { result = check_output_data(&mapped_memory); + iree_hal_buffer_unmap_range(&mapped_memory); } - iree_hal_buffer_unmap_range(&mapped_memory); iree_vm_list_release(inputs); iree_vm_list_release(outputs);