diff options
author | Takashi Iwai <tiwai@suse.de> | 2010-09-09 10:51:45 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-09-09 10:51:45 +0200 |
commit | c8bdfacb63c85d39ff55d365f1e48cce011b219e (patch) | |
tree | 402f659bdb919064dd7bced98c59de63994abe03 /sound/core/rawmidi.c | |
parent | add7c0a6a4b8669ebd726f9c08ba6002900ca671 (diff) | |
parent | a7a13d0676335a7dc9dd72264cca02606e43aaba (diff) |
Merge branch 'fix/misc' into topic/misc
Diffstat (limited to 'sound/core/rawmidi.c')
-rw-r--r-- | sound/core/rawmidi.c | 2 |
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(®ister_mutex); device = device < 0 ? 0 : device + 1; while (device < SNDRV_RAWMIDI_DEVICES) { |