aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/oss/route.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/core/oss/route.c')
-rw-r--r--sound/core/oss/route.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sound/core/oss/route.c b/sound/core/oss/route.c
index da7ab7a3e82c..0dcc2870d537 100644
--- a/sound/core/oss/route.c
+++ b/sound/core/oss/route.c
@@ -54,7 +54,8 @@ static snd_pcm_sframes_t route_transfer(struct snd_pcm_plugin *plugin,
54 struct snd_pcm_plugin_channel *dvp; 54 struct snd_pcm_plugin_channel *dvp;
55 int format; 55 int format;
56 56
57 snd_assert(plugin != NULL && src_channels != NULL && dst_channels != NULL, return -ENXIO); 57 if (snd_BUG_ON(!plugin || !src_channels || !dst_channels))
58 return -ENXIO;
58 if (frames == 0) 59 if (frames == 0)
59 return 0; 60 return 0;
60 61
@@ -90,10 +91,13 @@ int snd_pcm_plugin_build_route(struct snd_pcm_substream *plug,
90 struct snd_pcm_plugin *plugin; 91 struct snd_pcm_plugin *plugin;
91 int err; 92 int err;
92 93
93 snd_assert(r_plugin != NULL, return -ENXIO); 94 if (snd_BUG_ON(!r_plugin))
95 return -ENXIO;
94 *r_plugin = NULL; 96 *r_plugin = NULL;
95 snd_assert(src_format->rate == dst_format->rate, return -ENXIO); 97 if (snd_BUG_ON(src_format->rate != dst_format->rate))
96 snd_assert(src_format->format == dst_format->format, return -ENXIO); 98 return -ENXIO;
99 if (snd_BUG_ON(src_format->format != dst_format->format))
100 return -ENXIO;
97 101
98 err = snd_pcm_plugin_build(plug, "route conversion", 102 err = snd_pcm_plugin_build(plug, "route conversion",
99 src_format, dst_format, 0, &plugin); 103 src_format, dst_format, 0, &plugin);