summaryrefslogtreecommitdiff
path: root/vulkan/libvulkan/driver.cpp
diff options
context:
space:
mode:
author Ian Elliott <ianelliott@google.com> 2024-01-09 12:48:12 -0700
committer Ian Elliott <ianelliott@google.com> 2024-01-09 13:46:49 -0700
commita5b72a135893f4c892de00494bdbf21bfcff64af (patch)
treef48f53401f573e8b26fa402019880915208407d0 /vulkan/libvulkan/driver.cpp
parentea783adf1603ddac6d9a1316cd2a97cfaccde7f7 (diff)
Vulkan: Don't close HAL inside of an assert
Bug: 282237072 Test: Compile with asserts disabled Change-Id: Ideed507af4f6422db32f85c5ef70d8c62d21d5c9
Diffstat (limited to 'vulkan/libvulkan/driver.cpp')
-rw-r--r--vulkan/libvulkan/driver.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/vulkan/libvulkan/driver.cpp b/vulkan/libvulkan/driver.cpp
index 0e45d2d8c4..81fd1185b6 100644
--- a/vulkan/libvulkan/driver.cpp
+++ b/vulkan/libvulkan/driver.cpp
@@ -340,8 +340,9 @@ void Hal::UnloadBuiltinDriver() {
ALOGD("Unload builtin Vulkan driver.");
// Close the opened device
- ALOG_ASSERT(!hal_.dev_->common.close(hal_.dev_->common),
- "hw_device_t::close() failed.");
+ int err = hal_.dev_->common.close(
+ const_cast<struct hw_device_t*>(&hal_.dev_->common));
+ ALOG_ASSERT(!err, "hw_device_t::close() failed.");
// Close the opened shared library in the hw_module_t
android_unload_sphal_library(hal_.dev_->common.module->dso);