aboutsummaryrefslogtreecommitdiff
path: root/sound/core/rawmidi.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2010-09-09 10:51:45 +0200
committerTakashi Iwai <tiwai@suse.de>2010-09-09 10:51:45 +0200
commitc8bdfacb63c85d39ff55d365f1e48cce011b219e (patch)
tree402f659bdb919064dd7bced98c59de63994abe03 /sound/core/rawmidi.c
parentadd7c0a6a4b8669ebd726f9c08ba6002900ca671 (diff)
parenta7a13d0676335a7dc9dd72264cca02606e43aaba (diff)
Merge branch 'fix/misc' into topic/misc
Diffstat (limited to 'sound/core/rawmidi.c')
-rw-r--r--sound/core/rawmidi.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c
index eb68326c37d..a7868ad4d53 100644
--- a/sound/core/rawmidi.c
+++ b/sound/core/rawmidi.c
@@ -829,6 +829,8 @@ static int snd_rawmidi_control_ioctl(struct snd_card *card,
if (get_user(device, (int __user *)argp))
return -EFAULT;
+ if (device >= SNDRV_RAWMIDI_DEVICES) /* next device is -1 */
+ device = SNDRV_RAWMIDI_DEVICES - 1;
mutex_lock(&register_mutex);
device = device < 0 ? 0 : device + 1;
while (device < SNDRV_RAWMIDI_DEVICES) {