platform_drv: aquire_single_device return first

* Only acquire and return the first device

Fix genodelabs/genode#4614
This commit is contained in:
Stefan Kalkowski 2022-08-31 11:30:37 +02:00 committed by Christian Helmuth
parent f25070d441
commit 4b9fb10fdb

View File

@ -153,7 +153,7 @@ Session_component::acquire_single_device()
Capability<Platform::Device_interface> cap;
_devices.for_each([&] (Device & dev) {
if (matches(dev) && !dev.owner().valid())
if (!cap.valid() && matches(dev) && !dev.owner().valid())
cap = _acquire(dev); });
return cap;