Skip to content

Commit 5461e05

Browse files
committed
ALSA: pcm: oss: Remove WARNING from snd_pcm_plug_alloc() checks
The return value checks in snd_pcm_plug_alloc() are covered with snd_BUG_ON() macro that may trigger a kernel WARNING depending on the kconfig. But since the error condition can be triggered by a weird user space parameter passed to OSS layer, we shouldn't give the kernel stack trace just for that. As it's a normal error condition, let's remove snd_BUG_ON() macro usage there. Reported-by: [email protected] Cc: <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 3b36b13 commit 5461e05

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sound/core/oss/pcm_plugin.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ int snd_pcm_plug_alloc(struct snd_pcm_substream *plug, snd_pcm_uframes_t frames)
111111
while (plugin->next) {
112112
if (plugin->dst_frames)
113113
frames = plugin->dst_frames(plugin, frames);
114-
if (snd_BUG_ON((snd_pcm_sframes_t)frames <= 0))
114+
if ((snd_pcm_sframes_t)frames <= 0)
115115
return -ENXIO;
116116
plugin = plugin->next;
117117
err = snd_pcm_plugin_alloc(plugin, frames);
@@ -123,7 +123,7 @@ int snd_pcm_plug_alloc(struct snd_pcm_substream *plug, snd_pcm_uframes_t frames)
123123
while (plugin->prev) {
124124
if (plugin->src_frames)
125125
frames = plugin->src_frames(plugin, frames);
126-
if (snd_BUG_ON((snd_pcm_sframes_t)frames <= 0))
126+
if ((snd_pcm_sframes_t)frames <= 0)
127127
return -ENXIO;
128128
plugin = plugin->prev;
129129
err = snd_pcm_plugin_alloc(plugin, frames);

0 commit comments

Comments
 (0)