Commit 6665bb30 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: pcm: oss: Handle missing errors in snd_pcm_oss_change_params*()

A couple of calls in snd_pcm_oss_change_params_locked() ignore the
possible errors.  Catch those errors and abort the operation for
avoiding further problems.

Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20211201073606.11660-4-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 8839c8c0
...@@ -884,8 +884,15 @@ static int snd_pcm_oss_change_params_locked(struct snd_pcm_substream *substream) ...@@ -884,8 +884,15 @@ static int snd_pcm_oss_change_params_locked(struct snd_pcm_substream *substream)
err = -EINVAL; err = -EINVAL;
goto failure; goto failure;
} }
choose_rate(substream, sparams, runtime->oss.rate);
snd_pcm_hw_param_near(substream, sparams, SNDRV_PCM_HW_PARAM_CHANNELS, runtime->oss.channels, NULL); err = choose_rate(substream, sparams, runtime->oss.rate);
if (err < 0)
goto failure;
err = snd_pcm_hw_param_near(substream, sparams,
SNDRV_PCM_HW_PARAM_CHANNELS,
runtime->oss.channels, NULL);
if (err < 0)
goto failure;
format = snd_pcm_oss_format_from(runtime->oss.format); format = snd_pcm_oss_format_from(runtime->oss.format);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment