Skip to content

Commit

Permalink
[ALSA] Handle the error correctly in SNDCTL_DSP_SETFMT ioctl
Browse files Browse the repository at this point in the history
Handle the error returned from snd_pcm_oss_get_formats() correctly
in SNDCTL_DSP_SETFMT ioctl handler of PCM OSS emulation.

Signed-off-by: Steven Finney <sfinney@healthhero.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Steven Finney authored and Jaroslav Kysela committed Apr 27, 2006
1 parent bc56eff commit 5c59e09
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sound/core/oss/pcm_oss.c
Original file line number Diff line number Diff line change
Expand Up @@ -1242,6 +1242,8 @@ static int snd_pcm_oss_set_format(struct snd_pcm_oss_file *pcm_oss_file, int for

if (format != AFMT_QUERY) {
formats = snd_pcm_oss_get_formats(pcm_oss_file);
if (formats < 0)
return formats;
if (!(formats & format))
format = AFMT_U8;
for (idx = 1; idx >= 0; --idx) {
Expand Down

0 comments on commit 5c59e09

Please sign in to comment.