Skip to content

Commit

Permalink
ALSA: pcm: oss: Remove superfluous WARN_ON() for mulaw sanity check
Browse files Browse the repository at this point in the history
The PCM OSS mulaw plugin has a check of the format of the counter part
whether it's a linear format.  The check is with snd_BUG_ON() that
emits WARN_ON() when the debug config is set, and it confuses
syzkaller as if it were a serious issue.  Let's drop snd_BUG_ON() for
avoiding that.

While we're at it, correct the error code to a more suitable, EINVAL.

Reported-by: [email protected]
Cc: <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
tiwai committed Sep 1, 2020
1 parent 15cbff3 commit 949a1eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sound/core/oss/mulaw.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,8 @@ int snd_pcm_plugin_build_mulaw(struct snd_pcm_substream *plug,
snd_BUG();
return -EINVAL;
}
if (snd_BUG_ON(!snd_pcm_format_linear(format->format)))
return -ENXIO;
if (!snd_pcm_format_linear(format->format))
return -EINVAL;

err = snd_pcm_plugin_build(plug, "Mu-Law<->linear conversion",
src_format, dst_format,
Expand Down

0 comments on commit 949a1eb

Please sign in to comment.