summaryrefslogtreecommitdiffstats
path: root/sound/core/hwdep.c
diff options
context:
space:
mode:
authorFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2011-11-21 23:42:06 +0000
committerFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2011-11-21 23:42:06 +0000
commit300e812db26f4aa022e346f5fb9af1af134d98d8 (patch)
tree382b45253a704087e8aa0c770bf3fc2ad67d4b02 /sound/core/hwdep.c
parent4420dd2b306f1997232a13462bca0d420be5b1b8 (diff)
parentcfcfc9eca2bcbd26a8e206baeb005b055dbf8e37 (diff)
Merge commit 'v3.2-rc2' into fbdev-next
Diffstat (limited to 'sound/core/hwdep.c')
-rw-r--r--sound/core/hwdep.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sound/core/hwdep.c b/sound/core/hwdep.c
index a70ee7f1ed9..75ea16f35b1 100644
--- a/sound/core/hwdep.c
+++ b/sound/core/hwdep.c
@@ -24,6 +24,7 @@
#include <linux/slab.h>
#include <linux/time.h>
#include <linux/mutex.h>
+#include <linux/module.h>
#include <sound/core.h>
#include <sound/control.h>
#include <sound/minors.h>
@@ -272,7 +273,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;