mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 00:38:48 +02:00
clover: Handle NULL devices returned by pipe_loader_probe() v2
When probing for devices, clover will call pipe_loader_probe() twice.
The first time to retrieve the number of devices, and then second time
to retrieve the device structures.
We currently assume that the return value of both calls will be the
same, but this will not be the case if a device happens to disappear
between the two calls.
When a device disappears, the pipe_loader_probe() will add a NULL
device to the device list, so we need to handle this.
v2:
- Keep range for loop
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
CC: <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 9adbb9e713)
This commit is contained in:
parent
15344c978b
commit
be20f1d7c1
1 changed files with 2 additions and 1 deletions
|
|
@ -32,7 +32,8 @@ platform::platform() : adaptor_range(evals(), devs) {
|
|||
|
||||
for (pipe_loader_device *ldev : ldevs) {
|
||||
try {
|
||||
devs.push_back(create<device>(*this, ldev));
|
||||
if (ldev)
|
||||
devs.push_back(create<device>(*this, ldev));
|
||||
} catch (error &) {
|
||||
pipe_loader_release(&ldev, 1);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue