aboutsummaryrefslogtreecommitdiffstats
path: root/sound/drivers/opl3
diff options
context:
space:
mode:
Diffstat (limited to 'sound/drivers/opl3')
-rw-r--r--sound/drivers/opl3/opl3_lib.c6
-rw-r--r--sound/drivers/opl3/opl3_midi.c6
-rw-r--r--sound/drivers/opl3/opl3_oss.c15
-rw-r--r--sound/drivers/opl3/opl3_synth.c3
4 files changed, 20 insertions, 10 deletions
diff --git a/sound/drivers/opl3/opl3_lib.c b/sound/drivers/opl3/opl3_lib.c
index ebe4359047cb..780582340fef 100644
--- a/sound/drivers/opl3/opl3_lib.c
+++ b/sound/drivers/opl3/opl3_lib.c
@@ -139,7 +139,8 @@ static int snd_opl3_detect(struct snd_opl3 * opl3)
139 * If we had an OPL4 chip, opl3->hardware would have been set 139 * If we had an OPL4 chip, opl3->hardware would have been set
140 * by the OPL4 driver; so we can assume OPL3 here. 140 * by the OPL4 driver; so we can assume OPL3 here.
141 */ 141 */
142 snd_assert(opl3->r_port != 0, return -ENODEV); 142 if (snd_BUG_ON(!opl3->r_port))
143 return -ENODEV;
143 opl3->hardware = OPL3_HW_OPL3; 144 opl3->hardware = OPL3_HW_OPL3;
144 } 145 }
145 return 0; 146 return 0;
@@ -324,7 +325,8 @@ EXPORT_SYMBOL(snd_opl3_interrupt);
324 325
325static int snd_opl3_free(struct snd_opl3 *opl3) 326static int snd_opl3_free(struct snd_opl3 *opl3)
326{ 327{
327 snd_assert(opl3 != NULL, return -ENXIO); 328 if (snd_BUG_ON(!opl3))
329 return -ENXIO;
328 if (opl3->private_free) 330 if (opl3->private_free)
329 opl3->private_free(opl3); 331 opl3->private_free(opl3);
330 snd_opl3_clear_patches(opl3); 332 snd_opl3_clear_patches(opl3);
diff --git a/sound/drivers/opl3/opl3_midi.c b/sound/drivers/opl3/opl3_midi.c
index cebcb8b78acb..16feafa2c51e 100644
--- a/sound/drivers/opl3/opl3_midi.c
+++ b/sound/drivers/opl3/opl3_midi.c
@@ -617,7 +617,8 @@ static void snd_opl3_kill_voice(struct snd_opl3 *opl3, int voice)
617 617
618 struct snd_opl3_voice *vp, *vp2; 618 struct snd_opl3_voice *vp, *vp2;
619 619
620 snd_assert(voice < MAX_OPL3_VOICES, return); 620 if (snd_BUG_ON(voice >= MAX_OPL3_VOICES))
621 return;
621 622
622 vp = &opl3->voices[voice]; 623 vp = &opl3->voices[voice];
623 if (voice < MAX_OPL2_VOICES) { 624 if (voice < MAX_OPL2_VOICES) {
@@ -737,7 +738,8 @@ static void snd_opl3_update_pitch(struct snd_opl3 *opl3, int voice)
737 738
738 struct snd_opl3_voice *vp; 739 struct snd_opl3_voice *vp;
739 740
740 snd_assert(voice < MAX_OPL3_VOICES, return); 741 if (snd_BUG_ON(voice >= MAX_OPL3_VOICES))
742 return;
741 743
742 vp = &opl3->voices[voice]; 744 vp = &opl3->voices[voice];
743 if (vp->chan == NULL) 745 if (vp->chan == NULL)
diff --git a/sound/drivers/opl3/opl3_oss.c b/sound/drivers/opl3/opl3_oss.c
index 239347f26154..9a2271dc046a 100644
--- a/sound/drivers/opl3/opl3_oss.c
+++ b/sound/drivers/opl3/opl3_oss.c
@@ -162,7 +162,8 @@ static int snd_opl3_open_seq_oss(struct snd_seq_oss_arg *arg, void *closure)
162 struct snd_opl3 *opl3 = closure; 162 struct snd_opl3 *opl3 = closure;
163 int err; 163 int err;
164 164
165 snd_assert(arg != NULL, return -ENXIO); 165 if (snd_BUG_ON(!arg))
166 return -ENXIO;
166 167
167 if ((err = snd_opl3_synth_setup(opl3)) < 0) 168 if ((err = snd_opl3_synth_setup(opl3)) < 0)
168 return err; 169 return err;
@@ -184,7 +185,8 @@ static int snd_opl3_close_seq_oss(struct snd_seq_oss_arg *arg)
184{ 185{
185 struct snd_opl3 *opl3; 186 struct snd_opl3 *opl3;
186 187
187 snd_assert(arg != NULL, return -ENXIO); 188 if (snd_BUG_ON(!arg))
189 return -ENXIO;
188 opl3 = arg->private_data; 190 opl3 = arg->private_data;
189 191
190 snd_opl3_synth_cleanup(opl3); 192 snd_opl3_synth_cleanup(opl3);
@@ -206,7 +208,8 @@ static int snd_opl3_load_patch_seq_oss(struct snd_seq_oss_arg *arg, int format,
206 char name[32]; 208 char name[32];
207 int err, type; 209 int err, type;
208 210
209 snd_assert(arg != NULL, return -ENXIO); 211 if (snd_BUG_ON(!arg))
212 return -ENXIO;
210 opl3 = arg->private_data; 213 opl3 = arg->private_data;
211 214
212 if (format == FM_PATCH) 215 if (format == FM_PATCH)
@@ -246,7 +249,8 @@ static int snd_opl3_ioctl_seq_oss(struct snd_seq_oss_arg *arg, unsigned int cmd,
246{ 249{
247 struct snd_opl3 *opl3; 250 struct snd_opl3 *opl3;
248 251
249 snd_assert(arg != NULL, return -ENXIO); 252 if (snd_BUG_ON(!arg))
253 return -ENXIO;
250 opl3 = arg->private_data; 254 opl3 = arg->private_data;
251 switch (cmd) { 255 switch (cmd) {
252 case SNDCTL_FM_LOAD_INSTR: 256 case SNDCTL_FM_LOAD_INSTR:
@@ -271,7 +275,8 @@ static int snd_opl3_reset_seq_oss(struct snd_seq_oss_arg *arg)
271{ 275{
272 struct snd_opl3 *opl3; 276 struct snd_opl3 *opl3;
273 277
274 snd_assert(arg != NULL, return -ENXIO); 278 if (snd_BUG_ON(!arg))
279 return -ENXIO;
275 opl3 = arg->private_data; 280 opl3 = arg->private_data;
276 281
277 return 0; 282 return 0;
diff --git a/sound/drivers/opl3/opl3_synth.c b/sound/drivers/opl3/opl3_synth.c
index fb64c890109b..962bb9c8b9c8 100644
--- a/sound/drivers/opl3/opl3_synth.c
+++ b/sound/drivers/opl3/opl3_synth.c
@@ -92,7 +92,8 @@ int snd_opl3_ioctl(struct snd_hwdep * hw, struct file *file,
92 struct snd_opl3 *opl3 = hw->private_data; 92 struct snd_opl3 *opl3 = hw->private_data;
93 void __user *argp = (void __user *)arg; 93 void __user *argp = (void __user *)arg;
94 94
95 snd_assert(opl3 != NULL, return -EINVAL); 95 if (snd_BUG_ON(!opl3))
96 return -EINVAL;
96 97
97 switch (cmd) { 98 switch (cmd) {
98 /* get information */ 99 /* get information */