[Mesa-dev] [PATCH] clover: Handle NULL pipe_loader_device returned by pipe_loader_probe()

Tom Stellard thomas.stellard at amd.com
Mon Nov 30 08:16:22 PST 2015


pipe_loader_probe() may initalize an entry in the device list to NULL,
while still counting this device in the number of devices that it
returns, so we need to handle this situation.
---

This is the most simple fix possible to get clover working again.  We can
discuss fixing the other issues in clover in a follow on patch.

src/gallium/state_trackers/clover/core/platform.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/gallium/state_trackers/clover/core/platform.cpp b/src/gallium/state_trackers/clover/core/platform.cpp
index 328b71c..871b90e 100644
--- a/src/gallium/state_trackers/clover/core/platform.cpp
+++ b/src/gallium/state_trackers/clover/core/platform.cpp
@@ -31,6 +31,9 @@ platform::platform() : adaptor_range(evals(), devs) {
    pipe_loader_probe(&ldevs.front(), n);
 
    for (pipe_loader_device *ldev : ldevs) {
+      if (!ldev) {
+         continue;
+      }
       try {
          devs.push_back(create<device>(*this, ldev));
       } catch (error &) {
-- 
2.0.4



More information about the mesa-dev mailing list