mirror of
https://github.com/rust-vmm/vhost-device.git
synced 2025-12-26 22:48:17 +00:00
sound/alsa: fix missing StreamWithIdNotFound check
stop() was not returning an error if stream_id was invalid, it was succeeding. Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
This commit is contained in:
parent
c0c75d36ff
commit
30fb9b7766
@ -645,12 +645,14 @@ impl AudioBackend for AlsaBackend {
|
||||
}
|
||||
|
||||
fn stop(&self, id: u32) -> CrateResult<()> {
|
||||
if let Some(Err(err)) = self
|
||||
if let Err(err) = self
|
||||
.streams
|
||||
.write()
|
||||
.unwrap()
|
||||
.get_mut(id as usize)
|
||||
.map(|s| s.state.stop())
|
||||
.ok_or_else(|| Error::StreamWithIdNotFound(id))?
|
||||
.state
|
||||
.stop()
|
||||
{
|
||||
log::error!("Stream {} stop {}", id, err);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user