kms: Don't incorrectly re-use iterator in update_surface_nodes

This commit is contained in:
Victoria Brekenfeld 2025-07-28 17:18:11 +02:00 committed by Victoria Brekenfeld
parent 6492629f90
commit fd85e4ea56
2 changed files with 11 additions and 10 deletions

View file

@ -872,7 +872,7 @@ impl InnerDevice {
pub fn update_surface_nodes<'b>(
&mut self,
used_devices: &HashSet<DrmNode>,
mut others: impl Iterator<Item = &'b Self>,
others: &[&'b mut Self],
) -> Result<()>
where
Self: 'b,
@ -891,7 +891,10 @@ impl InnerDevice {
self.gbm.clone(),
)
} else {
let device = others.find(|d| d.render_node == *new_device).unwrap();
let device = others
.iter()
.find(|d| d.render_node == *new_device)
.unwrap();
(
device.render_node,
device.egl.as_ref().unwrap(),