Skip to content

Commit 07977a3

Browse files
tiwaigregkh
authored andcommitted
ALSA: pcm: oss: Handle missing errors in snd_pcm_oss_change_params*()
commit 6665bb3 upstream. 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.de Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent ad45bab commit 07977a3

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

‎sound/core/oss/pcm_oss.c‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -884,8 +884,15 @@ static int snd_pcm_oss_change_params_locked(struct snd_pcm_substream *substream)
884884
err = -EINVAL;
885885
goto failure;
886886
}
887-
choose_rate(substream, sparams, runtime->oss.rate);
888-
snd_pcm_hw_param_near(substream, sparams, SNDRV_PCM_HW_PARAM_CHANNELS, runtime->oss.channels, NULL);
887+
888+
err = choose_rate(substream, sparams, runtime->oss.rate);
889+
if (err < 0)
890+
goto failure;
891+
err = snd_pcm_hw_param_near(substream, sparams,
892+
SNDRV_PCM_HW_PARAM_CHANNELS,
893+
runtime->oss.channels, NULL);
894+
if (err < 0)
895+
goto failure;
889896

890897
format = snd_pcm_oss_format_from(runtime->oss.format);
891898

0 commit comments

Comments
 (0)