diff options
Diffstat (limited to 'sound/core/oss/io.c')
-rw-r--r-- | sound/core/oss/io.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/sound/core/oss/io.c b/sound/core/oss/io.c index f874f6ca3657..6faa1d719206 100644 --- a/sound/core/oss/io.c +++ b/sound/core/oss/io.c | |||
@@ -39,14 +39,17 @@ static snd_pcm_sframes_t io_playback_transfer(struct snd_pcm_plugin *plugin, | |||
39 | struct snd_pcm_plugin_channel *dst_channels, | 39 | struct snd_pcm_plugin_channel *dst_channels, |
40 | snd_pcm_uframes_t frames) | 40 | snd_pcm_uframes_t frames) |
41 | { | 41 | { |
42 | snd_assert(plugin != NULL, return -ENXIO); | 42 | if (snd_BUG_ON(!plugin)) |
43 | snd_assert(src_channels != NULL, return -ENXIO); | 43 | return -ENXIO; |
44 | if (snd_BUG_ON(!src_channels)) | ||
45 | return -ENXIO; | ||
44 | if (plugin->access == SNDRV_PCM_ACCESS_RW_INTERLEAVED) { | 46 | if (plugin->access == SNDRV_PCM_ACCESS_RW_INTERLEAVED) { |
45 | return pcm_write(plugin->plug, src_channels->area.addr, frames); | 47 | return pcm_write(plugin->plug, src_channels->area.addr, frames); |
46 | } else { | 48 | } else { |
47 | int channel, channels = plugin->dst_format.channels; | 49 | int channel, channels = plugin->dst_format.channels; |
48 | void **bufs = (void**)plugin->extra_data; | 50 | void **bufs = (void**)plugin->extra_data; |
49 | snd_assert(bufs != NULL, return -ENXIO); | 51 | if (snd_BUG_ON(!bufs)) |
52 | return -ENXIO; | ||
50 | for (channel = 0; channel < channels; channel++) { | 53 | for (channel = 0; channel < channels; channel++) { |
51 | if (src_channels[channel].enabled) | 54 | if (src_channels[channel].enabled) |
52 | bufs[channel] = src_channels[channel].area.addr; | 55 | bufs[channel] = src_channels[channel].area.addr; |
@@ -62,14 +65,17 @@ static snd_pcm_sframes_t io_capture_transfer(struct snd_pcm_plugin *plugin, | |||
62 | struct snd_pcm_plugin_channel *dst_channels, | 65 | struct snd_pcm_plugin_channel *dst_channels, |
63 | snd_pcm_uframes_t frames) | 66 | snd_pcm_uframes_t frames) |
64 | { | 67 | { |
65 | snd_assert(plugin != NULL, return -ENXIO); | 68 | if (snd_BUG_ON(!plugin)) |
66 | snd_assert(dst_channels != NULL, return -ENXIO); | 69 | return -ENXIO; |
70 | if (snd_BUG_ON(!dst_channels)) | ||
71 | return -ENXIO; | ||
67 | if (plugin->access == SNDRV_PCM_ACCESS_RW_INTERLEAVED) { | 72 | if (plugin->access == SNDRV_PCM_ACCESS_RW_INTERLEAVED) { |
68 | return pcm_read(plugin->plug, dst_channels->area.addr, frames); | 73 | return pcm_read(plugin->plug, dst_channels->area.addr, frames); |
69 | } else { | 74 | } else { |
70 | int channel, channels = plugin->dst_format.channels; | 75 | int channel, channels = plugin->dst_format.channels; |
71 | void **bufs = (void**)plugin->extra_data; | 76 | void **bufs = (void**)plugin->extra_data; |
72 | snd_assert(bufs != NULL, return -ENXIO); | 77 | if (snd_BUG_ON(!bufs)) |
78 | return -ENXIO; | ||
73 | for (channel = 0; channel < channels; channel++) { | 79 | for (channel = 0; channel < channels; channel++) { |
74 | if (dst_channels[channel].enabled) | 80 | if (dst_channels[channel].enabled) |
75 | bufs[channel] = dst_channels[channel].area.addr; | 81 | bufs[channel] = dst_channels[channel].area.addr; |
@@ -107,9 +113,11 @@ int snd_pcm_plugin_build_io(struct snd_pcm_substream *plug, | |||
107 | struct snd_pcm_plugin_format format; | 113 | struct snd_pcm_plugin_format format; |
108 | struct snd_pcm_plugin *plugin; | 114 | struct snd_pcm_plugin *plugin; |
109 | 115 | ||
110 | snd_assert(r_plugin != NULL, return -ENXIO); | 116 | if (snd_BUG_ON(!r_plugin)) |
117 | return -ENXIO; | ||
111 | *r_plugin = NULL; | 118 | *r_plugin = NULL; |
112 | snd_assert(plug != NULL && params != NULL, return -ENXIO); | 119 | if (snd_BUG_ON(!plug || !params)) |
120 | return -ENXIO; | ||
113 | format.format = params_format(params); | 121 | format.format = params_format(params); |
114 | format.rate = params_rate(params); | 122 | format.rate = params_rate(params); |
115 | format.channels = params_channels(params); | 123 | format.channels = params_channels(params); |