aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-07-03 17:10:23 -0400
committerTakashi Iwai <tiwai@suse.de>2009-07-03 17:10:23 -0400
commitc470331e69bd54d11a9ea3c27a0e4ad783d02d6b (patch)
tree40966f94ea8ea1bb12373df23644f8ee803820b9 /sound
parent70d321e6380f128096429d6e5b678f94ab0cef5d (diff)
ALSA: hda - Add sanity check in PCM open callback
Add some sanity checks of struct snd_pcm_hardware fields in the PCM open callback of hda driver. This makes a bit easier to debug any PCM setup errors in the codec side. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/hda_intel.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index b36dc46615a4..1877d95d4aa6 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -1464,6 +1464,12 @@ static int azx_pcm_open(struct snd_pcm_substream *substream)
1464 snd_pcm_set_sync(substream); 1464 snd_pcm_set_sync(substream);
1465 mutex_unlock(&chip->open_mutex); 1465 mutex_unlock(&chip->open_mutex);
1466 1466
1467 if (snd_BUG_ON(!runtime->hw.channels_min || !runtime->hw.channels_max))
1468 return -EINVAL;
1469 if (snd_BUG_ON(!runtime->hw.formats))
1470 return -EINVAL;
1471 if (snd_BUG_ON(!runtime->hw.rates))
1472 return -EINVAL;
1467 return 0; 1473 return 0;
1468} 1474}
1469 1475