aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa
diff options
context:
space:
mode:
Diffstat (limited to 'sound/isa')
-rw-r--r--sound/isa/ad1816a/ad1816a_lib.c6
-rw-r--r--sound/isa/cs423x/cs4236_lib.c3
-rw-r--r--sound/isa/es1688/es1688_lib.c3
-rw-r--r--sound/isa/gus/gus_main.c6
-rw-r--r--sound/isa/gus/gus_mixer.c6
-rw-r--r--sound/isa/gus/gus_pcm.c12
-rw-r--r--sound/isa/opti9xx/miro.c3
-rw-r--r--sound/isa/sb/emu8000.c3
-rw-r--r--sound/isa/sb/emu8000_patch.c3
-rw-r--r--sound/isa/sb/sb16_csp.c9
-rw-r--r--sound/isa/sb/sb16_main.c3
-rw-r--r--sound/isa/sb/sb8_main.c8
-rw-r--r--sound/isa/sb/sb_common.c3
-rw-r--r--sound/isa/sb/sb_mixer.c9
-rw-r--r--sound/isa/wavefront/wavefront_fx.c8
-rw-r--r--sound/isa/wavefront/wavefront_midi.c24
-rw-r--r--sound/isa/wavefront/wavefront_synth.c7
-rw-r--r--sound/isa/wss/wss_lib.c6
18 files changed, 80 insertions, 42 deletions
diff --git a/sound/isa/ad1816a/ad1816a_lib.c b/sound/isa/ad1816a/ad1816a_lib.c
index 4b8dfe2e3dcb..3bfca7c59baf 100644
--- a/sound/isa/ad1816a/ad1816a_lib.c
+++ b/sound/isa/ad1816a/ad1816a_lib.c
@@ -394,7 +394,8 @@ static int snd_ad1816a_timer_open(struct snd_timer *timer)
394 394
395static unsigned long snd_ad1816a_timer_resolution(struct snd_timer *timer) 395static unsigned long snd_ad1816a_timer_resolution(struct snd_timer *timer)
396{ 396{
397 snd_assert(timer != NULL, return 0); 397 if (snd_BUG_ON(!timer))
398 return 0;
398 399
399 return 10000; 400 return 10000;
400} 401}
@@ -961,7 +962,8 @@ int __devinit snd_ad1816a_mixer(struct snd_ad1816a *chip)
961 unsigned int idx; 962 unsigned int idx;
962 int err; 963 int err;
963 964
964 snd_assert(chip != NULL && chip->card != NULL, return -EINVAL); 965 if (snd_BUG_ON(!chip || !chip->card))
966 return -EINVAL;
965 967
966 card = chip->card; 968 card = chip->card;
967 969
diff --git a/sound/isa/cs423x/cs4236_lib.c b/sound/isa/cs423x/cs4236_lib.c
index 33e9cf178b8b..6a85fdc53b60 100644
--- a/sound/isa/cs423x/cs4236_lib.c
+++ b/sound/isa/cs423x/cs4236_lib.c
@@ -967,7 +967,8 @@ int snd_cs4236_mixer(struct snd_wss *chip)
967 int err; 967 int err;
968 struct snd_kcontrol_new *kcontrol; 968 struct snd_kcontrol_new *kcontrol;
969 969
970 snd_assert(chip != NULL && chip->card != NULL, return -EINVAL); 970 if (snd_BUG_ON(!chip || !chip->card))
971 return -EINVAL;
971 card = chip->card; 972 card = chip->card;
972 strcpy(card->mixername, snd_wss_chip_id(chip)); 973 strcpy(card->mixername, snd_wss_chip_id(chip));
973 974
diff --git a/sound/isa/es1688/es1688_lib.c b/sound/isa/es1688/es1688_lib.c
index 1e1e575b1db3..4fbb508a817f 100644
--- a/sound/isa/es1688/es1688_lib.c
+++ b/sound/isa/es1688/es1688_lib.c
@@ -1009,7 +1009,8 @@ int snd_es1688_mixer(struct snd_es1688 *chip)
1009 int err; 1009 int err;
1010 unsigned char reg, val; 1010 unsigned char reg, val;
1011 1011
1012 snd_assert(chip != NULL && chip->card != NULL, return -EINVAL); 1012 if (snd_BUG_ON(!chip || !chip->card))
1013 return -EINVAL;
1013 1014
1014 card = chip->card; 1015 card = chip->card;
1015 1016
diff --git a/sound/isa/gus/gus_main.c b/sound/isa/gus/gus_main.c
index cccc16c8113f..12eb98f2f931 100644
--- a/sound/isa/gus/gus_main.c
+++ b/sound/isa/gus/gus_main.c
@@ -276,9 +276,11 @@ static int snd_gus_init_dma_irq(struct snd_gus_card * gus, int latches)
276 static unsigned char dmas[8] = 276 static unsigned char dmas[8] =
277 {6, 1, 0, 2, 0, 3, 4, 5}; 277 {6, 1, 0, 2, 0, 3, 4, 5};
278 278
279 snd_assert(gus != NULL, return -EINVAL); 279 if (snd_BUG_ON(!gus))
280 return -EINVAL;
280 card = gus->card; 281 card = gus->card;
281 snd_assert(card != NULL, return -EINVAL); 282 if (snd_BUG_ON(!card))
283 return -EINVAL;
282 284
283 gus->mix_cntrl_reg &= 0xf8; 285 gus->mix_cntrl_reg &= 0xf8;
284 gus->mix_cntrl_reg |= 0x01; /* disable MIC, LINE IN, enable LINE OUT */ 286 gus->mix_cntrl_reg |= 0x01; /* disable MIC, LINE IN, enable LINE OUT */
diff --git a/sound/isa/gus/gus_mixer.c b/sound/isa/gus/gus_mixer.c
index ebdb33469306..0dd43414016e 100644
--- a/sound/isa/gus/gus_mixer.c
+++ b/sound/isa/gus/gus_mixer.c
@@ -161,9 +161,11 @@ int snd_gf1_new_mixer(struct snd_gus_card * gus)
161 unsigned int idx, max; 161 unsigned int idx, max;
162 int err; 162 int err;
163 163
164 snd_assert(gus != NULL, return -EINVAL); 164 if (snd_BUG_ON(!gus))
165 return -EINVAL;
165 card = gus->card; 166 card = gus->card;
166 snd_assert(card != NULL, return -EINVAL); 167 if (snd_BUG_ON(!card))
168 return -EINVAL;
167 169
168 if (gus->ics_flag) 170 if (gus->ics_flag)
169 snd_component_add(card, "ICS2101"); 171 snd_component_add(card, "ICS2101");
diff --git a/sound/isa/gus/gus_pcm.c b/sound/isa/gus/gus_pcm.c
index 99731dc97325..38510aeb21c6 100644
--- a/sound/isa/gus/gus_pcm.c
+++ b/sound/isa/gus/gus_pcm.c
@@ -352,8 +352,10 @@ static int snd_gf1_pcm_playback_copy(struct snd_pcm_substream *substream,
352 352
353 bpos = samples_to_bytes(runtime, pos) + (voice * (pcmp->dma_size / 2)); 353 bpos = samples_to_bytes(runtime, pos) + (voice * (pcmp->dma_size / 2));
354 len = samples_to_bytes(runtime, count); 354 len = samples_to_bytes(runtime, count);
355 snd_assert(bpos <= pcmp->dma_size, return -EIO); 355 if (snd_BUG_ON(bpos > pcmp->dma_size))
356 snd_assert(bpos + len <= pcmp->dma_size, return -EIO); 356 return -EIO;
357 if (snd_BUG_ON(bpos + len > pcmp->dma_size))
358 return -EIO;
357 if (copy_from_user(runtime->dma_area + bpos, src, len)) 359 if (copy_from_user(runtime->dma_area + bpos, src, len))
358 return -EFAULT; 360 return -EFAULT;
359 if (snd_gf1_pcm_use_dma && len > 32) { 361 if (snd_gf1_pcm_use_dma && len > 32) {
@@ -381,8 +383,10 @@ static int snd_gf1_pcm_playback_silence(struct snd_pcm_substream *substream,
381 383
382 bpos = samples_to_bytes(runtime, pos) + (voice * (pcmp->dma_size / 2)); 384 bpos = samples_to_bytes(runtime, pos) + (voice * (pcmp->dma_size / 2));
383 len = samples_to_bytes(runtime, count); 385 len = samples_to_bytes(runtime, count);
384 snd_assert(bpos <= pcmp->dma_size, return -EIO); 386 if (snd_BUG_ON(bpos > pcmp->dma_size))
385 snd_assert(bpos + len <= pcmp->dma_size, return -EIO); 387 return -EIO;
388 if (snd_BUG_ON(bpos + len > pcmp->dma_size))
389 return -EIO;
386 snd_pcm_format_set_silence(runtime->format, runtime->dma_area + bpos, count); 390 snd_pcm_format_set_silence(runtime->format, runtime->dma_area + bpos, count);
387 if (snd_gf1_pcm_use_dma && len > 32) { 391 if (snd_gf1_pcm_use_dma && len > 32) {
388 return snd_gf1_pcm_block_change(substream, bpos, pcmp->memory + bpos, len); 392 return snd_gf1_pcm_block_change(substream, bpos, pcmp->memory + bpos, len);
diff --git a/sound/isa/opti9xx/miro.c b/sound/isa/opti9xx/miro.c
index 4641daa7844d..440755cc0013 100644
--- a/sound/isa/opti9xx/miro.c
+++ b/sound/isa/opti9xx/miro.c
@@ -675,7 +675,8 @@ static int __devinit snd_miro_mixer(struct snd_miro *miro)
675 unsigned int idx; 675 unsigned int idx;
676 int err; 676 int err;
677 677
678 snd_assert(miro != NULL && miro->card != NULL, return -EINVAL); 678 if (snd_BUG_ON(!miro || !miro->card))
679 return -EINVAL;
679 680
680 card = miro->card; 681 card = miro->card;
681 682
diff --git a/sound/isa/sb/emu8000.c b/sound/isa/sb/emu8000.c
index b35be7d9a9fa..96678d5d3834 100644
--- a/sound/isa/sb/emu8000.c
+++ b/sound/isa/sb/emu8000.c
@@ -1023,7 +1023,8 @@ snd_emu8000_create_mixer(struct snd_card *card, struct snd_emu8000 *emu)
1023{ 1023{
1024 int i, err = 0; 1024 int i, err = 0;
1025 1025
1026 snd_assert(emu != NULL && card != NULL, return -EINVAL); 1026 if (snd_BUG_ON(!emu || !card))
1027 return -EINVAL;
1027 1028
1028 spin_lock_init(&emu->control_lock); 1029 spin_lock_init(&emu->control_lock);
1029 1030
diff --git a/sound/isa/sb/emu8000_patch.c b/sound/isa/sb/emu8000_patch.c
index 1be16c9700f0..c99c6078be33 100644
--- a/sound/isa/sb/emu8000_patch.c
+++ b/sound/isa/sb/emu8000_patch.c
@@ -156,7 +156,8 @@ snd_emu8000_sample_new(struct snd_emux *rec, struct snd_sf_sample *sp,
156 struct snd_emu8000 *emu; 156 struct snd_emu8000 *emu;
157 157
158 emu = rec->hw; 158 emu = rec->hw;
159 snd_assert(sp != NULL, return -EINVAL); 159 if (snd_BUG_ON(!sp))
160 return -EINVAL;
160 161
161 if (sp->v.size == 0) 162 if (sp->v.size == 0)
162 return 0; 163 return 0;
diff --git a/sound/isa/sb/sb16_csp.c b/sound/isa/sb/sb16_csp.c
index 35f3d7b16536..49037d074c71 100644
--- a/sound/isa/sb/sb16_csp.c
+++ b/sound/isa/sb/sb16_csp.c
@@ -198,7 +198,8 @@ static int snd_sb_csp_ioctl(struct snd_hwdep * hw, struct file *file, unsigned i
198 struct snd_sb_csp_start start_info; 198 struct snd_sb_csp_start start_info;
199 int err; 199 int err;
200 200
201 snd_assert(p != NULL, return -EINVAL); 201 if (snd_BUG_ON(!p))
202 return -EINVAL;
202 203
203 if (snd_sb_csp_check_version(p)) 204 if (snd_sb_csp_check_version(p))
204 return -ENODEV; 205 return -ENODEV;
@@ -1046,7 +1047,8 @@ static int snd_sb_qsound_build(struct snd_sb_csp * p)
1046 struct snd_card *card; 1047 struct snd_card *card;
1047 int err; 1048 int err;
1048 1049
1049 snd_assert(p != NULL, return -EINVAL); 1050 if (snd_BUG_ON(!p))
1051 return -EINVAL;
1050 1052
1051 card = p->chip->card; 1053 card = p->chip->card;
1052 p->qpos_left = p->qpos_right = SNDRV_SB_CSP_QSOUND_MAX_RIGHT / 2; 1054 p->qpos_left = p->qpos_right = SNDRV_SB_CSP_QSOUND_MAX_RIGHT / 2;
@@ -1071,7 +1073,8 @@ static void snd_sb_qsound_destroy(struct snd_sb_csp * p)
1071 struct snd_card *card; 1073 struct snd_card *card;
1072 unsigned long flags; 1074 unsigned long flags;
1073 1075
1074 snd_assert(p != NULL, return); 1076 if (snd_BUG_ON(!p))
1077 return;
1075 1078
1076 card = p->chip->card; 1079 card = p->chip->card;
1077 1080
diff --git a/sound/isa/sb/sb16_main.c b/sound/isa/sb/sb16_main.c
index f7e8192270ae..2a6cc1cfe945 100644
--- a/sound/isa/sb/sb16_main.c
+++ b/sound/isa/sb/sb16_main.c
@@ -669,7 +669,8 @@ static int snd_sb16_capture_close(struct snd_pcm_substream *substream)
669static int snd_sb16_set_dma_mode(struct snd_sb *chip, int what) 669static int snd_sb16_set_dma_mode(struct snd_sb *chip, int what)
670{ 670{
671 if (chip->dma8 < 0 || chip->dma16 < 0) { 671 if (chip->dma8 < 0 || chip->dma16 < 0) {
672 snd_assert(what == 0, return -EINVAL); 672 if (snd_BUG_ON(what))
673 return -EINVAL;
673 return 0; 674 return 0;
674 } 675 }
675 if (what == 0) { 676 if (what == 0) {
diff --git a/sound/isa/sb/sb8_main.c b/sound/isa/sb/sb8_main.c
index fe03bb820532..658d55769c9c 100644
--- a/sound/isa/sb/sb8_main.c
+++ b/sound/isa/sb/sb8_main.c
@@ -111,7 +111,9 @@ static int snd_sb8_playback_prepare(struct snd_pcm_substream *substream)
111 switch (chip->hardware) { 111 switch (chip->hardware) {
112 case SB_HW_PRO: 112 case SB_HW_PRO:
113 if (runtime->channels > 1) { 113 if (runtime->channels > 1) {
114 snd_assert(rate == SB8_RATE(11025) || rate == SB8_RATE(22050), return -EINVAL); 114 if (snd_BUG_ON(rate != SB8_RATE(11025) &&
115 rate != SB8_RATE(22050)))
116 return -EINVAL;
115 chip->playback_format = SB_DSP_HI_OUTPUT_AUTO; 117 chip->playback_format = SB_DSP_HI_OUTPUT_AUTO;
116 break; 118 break;
117 } 119 }
@@ -237,7 +239,9 @@ static int snd_sb8_capture_prepare(struct snd_pcm_substream *substream)
237 switch (chip->hardware) { 239 switch (chip->hardware) {
238 case SB_HW_PRO: 240 case SB_HW_PRO:
239 if (runtime->channels > 1) { 241 if (runtime->channels > 1) {
240 snd_assert(rate == SB8_RATE(11025) || rate == SB8_RATE(22050), return -EINVAL); 242 if (snd_BUG_ON(rate != SB8_RATE(11025) &&
243 rate != SB8_RATE(22050)))
244 return -EINVAL;
241 chip->capture_format = SB_DSP_HI_INPUT_AUTO; 245 chip->capture_format = SB_DSP_HI_INPUT_AUTO;
242 break; 246 break;
243 } 247 }
diff --git a/sound/isa/sb/sb_common.c b/sound/isa/sb/sb_common.c
index b432d9ae874b..27a651502251 100644
--- a/sound/isa/sb/sb_common.c
+++ b/sound/isa/sb/sb_common.c
@@ -219,7 +219,8 @@ int snd_sbdsp_create(struct snd_card *card,
219 .dev_free = snd_sbdsp_dev_free, 219 .dev_free = snd_sbdsp_dev_free,
220 }; 220 };
221 221
222 snd_assert(r_chip != NULL, return -EINVAL); 222 if (snd_BUG_ON(!r_chip))
223 return -EINVAL;
223 *r_chip = NULL; 224 *r_chip = NULL;
224 chip = kzalloc(sizeof(*chip), GFP_KERNEL); 225 chip = kzalloc(sizeof(*chip), GFP_KERNEL);
225 if (chip == NULL) 226 if (chip == NULL)
diff --git a/sound/isa/sb/sb_mixer.c b/sound/isa/sb/sb_mixer.c
index 73d4572d136b..406a431af91e 100644
--- a/sound/isa/sb/sb_mixer.c
+++ b/sound/isa/sb/sb_mixer.c
@@ -792,7 +792,8 @@ int snd_sbmixer_new(struct snd_sb *chip)
792 struct snd_card *card; 792 struct snd_card *card;
793 int err; 793 int err;
794 794
795 snd_assert(chip != NULL && chip->card != NULL, return -EINVAL); 795 if (snd_BUG_ON(!chip || !chip->card))
796 return -EINVAL;
796 797
797 card = chip->card; 798 card = chip->card;
798 799
@@ -925,7 +926,8 @@ static unsigned char als4000_saved_regs[] = {
925static void save_mixer(struct snd_sb *chip, unsigned char *regs, int num_regs) 926static void save_mixer(struct snd_sb *chip, unsigned char *regs, int num_regs)
926{ 927{
927 unsigned char *val = chip->saved_regs; 928 unsigned char *val = chip->saved_regs;
928 snd_assert(num_regs <= ARRAY_SIZE(chip->saved_regs), return); 929 if (snd_BUG_ON(num_regs > ARRAY_SIZE(chip->saved_regs)))
930 return;
929 for (; num_regs; num_regs--) 931 for (; num_regs; num_regs--)
930 *val++ = snd_sbmixer_read(chip, *regs++); 932 *val++ = snd_sbmixer_read(chip, *regs++);
931} 933}
@@ -933,7 +935,8 @@ static void save_mixer(struct snd_sb *chip, unsigned char *regs, int num_regs)
933static void restore_mixer(struct snd_sb *chip, unsigned char *regs, int num_regs) 935static void restore_mixer(struct snd_sb *chip, unsigned char *regs, int num_regs)
934{ 936{
935 unsigned char *val = chip->saved_regs; 937 unsigned char *val = chip->saved_regs;
936 snd_assert(num_regs <= ARRAY_SIZE(chip->saved_regs), return); 938 if (snd_BUG_ON(num_regs > ARRAY_SIZE(chip->saved_regs)))
939 return;
937 for (; num_regs; num_regs--) 940 for (; num_regs; num_regs--)
938 snd_sbmixer_write(chip, *regs++, *val++); 941 snd_sbmixer_write(chip, *regs++, *val++);
939} 942}
diff --git a/sound/isa/wavefront/wavefront_fx.c b/sound/isa/wavefront/wavefront_fx.c
index 2efaa7f205aa..dfc449a2194e 100644
--- a/sound/isa/wavefront/wavefront_fx.c
+++ b/sound/isa/wavefront/wavefront_fx.c
@@ -180,11 +180,11 @@ snd_wavefront_fx_ioctl (struct snd_hwdep *sdev, struct file *file,
180 unsigned short *pd; 180 unsigned short *pd;
181 int err = 0; 181 int err = 0;
182 182
183 snd_assert(sdev->card != NULL, return -ENODEV);
184
185 card = sdev->card; 183 card = sdev->card;
186 184 if (snd_BUG_ON(!card))
187 snd_assert(card->private_data != NULL, return -ENODEV); 185 return -ENODEV;
186 if (snd_BUG_ON(!card->private_data))
187 return -ENODEV;
188 188
189 acard = card->private_data; 189 acard = card->private_data;
190 dev = &acard->wavefront; 190 dev = &acard->wavefront;
diff --git a/sound/isa/wavefront/wavefront_midi.c b/sound/isa/wavefront/wavefront_midi.c
index a33384a55b0f..f14a7c0b6998 100644
--- a/sound/isa/wavefront/wavefront_midi.c
+++ b/sound/isa/wavefront/wavefront_midi.c
@@ -235,8 +235,10 @@ static int snd_wavefront_midi_input_open(struct snd_rawmidi_substream *substream
235 snd_wavefront_midi_t *midi; 235 snd_wavefront_midi_t *midi;
236 snd_wavefront_mpu_id mpu; 236 snd_wavefront_mpu_id mpu;
237 237
238 snd_assert(substream != NULL && substream->rmidi != NULL, return -EIO); 238 if (snd_BUG_ON(!substream || !substream->rmidi))
239 snd_assert(substream->rmidi->private_data != NULL, return -EIO); 239 return -ENXIO;
240 if (snd_BUG_ON(!substream->rmidi->private_data))
241 return -ENXIO;
240 242
241 mpu = *((snd_wavefront_mpu_id *) substream->rmidi->private_data); 243 mpu = *((snd_wavefront_mpu_id *) substream->rmidi->private_data);
242 244
@@ -257,8 +259,10 @@ static int snd_wavefront_midi_output_open(struct snd_rawmidi_substream *substrea
257 snd_wavefront_midi_t *midi; 259 snd_wavefront_midi_t *midi;
258 snd_wavefront_mpu_id mpu; 260 snd_wavefront_mpu_id mpu;
259 261
260 snd_assert(substream != NULL && substream->rmidi != NULL, return -EIO); 262 if (snd_BUG_ON(!substream || !substream->rmidi))
261 snd_assert(substream->rmidi->private_data != NULL, return -EIO); 263 return -ENXIO;
264 if (snd_BUG_ON(!substream->rmidi->private_data))
265 return -ENXIO;
262 266
263 mpu = *((snd_wavefront_mpu_id *) substream->rmidi->private_data); 267 mpu = *((snd_wavefront_mpu_id *) substream->rmidi->private_data);
264 268
@@ -279,8 +283,10 @@ static int snd_wavefront_midi_input_close(struct snd_rawmidi_substream *substrea
279 snd_wavefront_midi_t *midi; 283 snd_wavefront_midi_t *midi;
280 snd_wavefront_mpu_id mpu; 284 snd_wavefront_mpu_id mpu;
281 285
282 snd_assert(substream != NULL && substream->rmidi != NULL, return -EIO); 286 if (snd_BUG_ON(!substream || !substream->rmidi))
283 snd_assert(substream->rmidi->private_data != NULL, return -EIO); 287 return -ENXIO;
288 if (snd_BUG_ON(!substream->rmidi->private_data))
289 return -ENXIO;
284 290
285 mpu = *((snd_wavefront_mpu_id *) substream->rmidi->private_data); 291 mpu = *((snd_wavefront_mpu_id *) substream->rmidi->private_data);
286 292
@@ -300,8 +306,10 @@ static int snd_wavefront_midi_output_close(struct snd_rawmidi_substream *substre
300 snd_wavefront_midi_t *midi; 306 snd_wavefront_midi_t *midi;
301 snd_wavefront_mpu_id mpu; 307 snd_wavefront_mpu_id mpu;
302 308
303 snd_assert(substream != NULL && substream->rmidi != NULL, return -EIO); 309 if (snd_BUG_ON(!substream || !substream->rmidi))
304 snd_assert(substream->rmidi->private_data != NULL, return -EIO); 310 return -ENXIO;
311 if (snd_BUG_ON(!substream->rmidi->private_data))
312 return -ENXIO;
305 313
306 mpu = *((snd_wavefront_mpu_id *) substream->rmidi->private_data); 314 mpu = *((snd_wavefront_mpu_id *) substream->rmidi->private_data);
307 315
diff --git a/sound/isa/wavefront/wavefront_synth.c b/sound/isa/wavefront/wavefront_synth.c
index 0bb9b9256601..4c410820a994 100644
--- a/sound/isa/wavefront/wavefront_synth.c
+++ b/sound/isa/wavefront/wavefront_synth.c
@@ -1648,9 +1648,10 @@ snd_wavefront_synth_ioctl (struct snd_hwdep *hw, struct file *file,
1648 1648
1649 card = (struct snd_card *) hw->card; 1649 card = (struct snd_card *) hw->card;
1650 1650
1651 snd_assert(card != NULL, return -ENODEV); 1651 if (snd_BUG_ON(!card))
1652 1652 return -ENODEV;
1653 snd_assert(card->private_data != NULL, return -ENODEV); 1653 if (snd_BUG_ON(!card->private_data))
1654 return -ENODEV;
1654 1655
1655 acard = card->private_data; 1656 acard = card->private_data;
1656 dev = &acard->wavefront; 1657 dev = &acard->wavefront;
diff --git a/sound/isa/wss/wss_lib.c b/sound/isa/wss/wss_lib.c
index 6b7a0fc6f71d..c5beec65936d 100644
--- a/sound/isa/wss/wss_lib.c
+++ b/sound/isa/wss/wss_lib.c
@@ -1946,7 +1946,8 @@ static int snd_wss_info_mux(struct snd_kcontrol *kcontrol,
1946 char **ptexts = texts; 1946 char **ptexts = texts;
1947 struct snd_wss *chip = snd_kcontrol_chip(kcontrol); 1947 struct snd_wss *chip = snd_kcontrol_chip(kcontrol);
1948 1948
1949 snd_assert(chip->card != NULL, return -EINVAL); 1949 if (snd_BUG_ON(!chip->card))
1950 return -EINVAL;
1950 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; 1951 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
1951 uinfo->count = 2; 1952 uinfo->count = 2;
1952 uinfo->value.enumerated.items = 4; 1953 uinfo->value.enumerated.items = 4;
@@ -2262,7 +2263,8 @@ int snd_wss_mixer(struct snd_wss *chip)
2262 unsigned int idx; 2263 unsigned int idx;
2263 int err; 2264 int err;
2264 2265
2265 snd_assert(chip != NULL && chip->pcm != NULL, return -EINVAL); 2266 if (snd_BUG_ON(!chip || !chip->pcm))
2267 return -EINVAL;
2266 2268
2267 card = chip->card; 2269 card = chip->card;
2268 2270