summaryrefslogtreecommitdiffstats
path: root/sound/core
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-11-04 07:51:43 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2011-11-04 07:51:43 -0700
commitb2409fb6a49d1f633a8fc488e48043da7d3fd6a7 (patch)
treef2e76570fe81901ed0b64f6c1c815fe4abcc87ea /sound/core
parent6b1506c66809ddf6afd17e330db2999c878b5d90 (diff)
parent6bcbf64ace40d6833622d85701218a8bb7a4f207 (diff)
downloadlinux-b2409fb6a49d1f633a8fc488e48043da7d3fd6a7.tar.gz
linux-b2409fb6a49d1f633a8fc488e48043da7d3fd6a7.tar.bz2
linux-b2409fb6a49d1f633a8fc488e48043da7d3fd6a7.zip
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (24 commits) ALSA: hda/realtek - Skip invalid digital out pins ALSA: hda/sigmatel - Automatically retrieve digital I/O widgets ALSA: hda - Remove unused variables ALSA: hda/realtek - Don't create alt-stream for capture when unnecessary ALSA: hda - Add support for 92HD65 / 92HD66 family of codecs ALSA: hda - Disable power-widget control for IDT 92HD83/93 as default ALSA: hda - Check NO_PRESENCE pincfg default bit ASoC: Ensure we always delay for WM8962 FLL when starting from SYSCLK ASoC: Ensure the WM8962 oscillator and PLLs start up disabled ASoC: Ensure WM8962 PLL registers are reset ALSA: intel8x0 - Fix inclusion of kvm_para.h ALSA: hda_hwdep: Fix possible buffer overflow ASoC: Fix return value of wm5100_gpio_direction_out() ASoC: WM8904: Set `invert' bit for Capture Switch ASoC: Leave input audio data bit length settings untouched in wm8711_set_dai_fmt ASoC: wm8711: Fix wrong mask for setting input audio data bit length select ALSA: intel8x0: Improve performance in virtual environment ALSA: hdspm - Enable all firmware ranges for PCI MADI/AES cards ALSA: hdsp - Correct HDSP_VERSION_BIT constant, thus partly fixing RPM detection ALSA: hdspm - Fix MADI channel format in the status ioctl ...
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/hwdep.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sound/core/hwdep.c b/sound/core/hwdep.c
index a70ee7f1ed98..031e215b6dde 100644
--- a/sound/core/hwdep.c
+++ b/sound/core/hwdep.c
@@ -272,7 +272,14 @@ static int snd_hwdep_control_ioctl(struct snd_card *card,
if (get_user(device, (int __user *)arg))
return -EFAULT;
mutex_lock(&register_mutex);
- device = device < 0 ? 0 : device + 1;
+
+ if (device < 0)
+ device = 0;
+ else if (device < SNDRV_MINOR_HWDEPS)
+ device++;
+ else
+ device = SNDRV_MINOR_HWDEPS;
+
while (device < SNDRV_MINOR_HWDEPS) {
if (snd_hwdep_search(card, device))
break;