diff --git a/[refs] b/[refs] index fb889640279e..dd040da1797a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 27f7ad53829f79e799a253285318bff79ece15bd +refs/heads/master: a7a13d0676335a7dc9dd72264cca02606e43aaba diff --git a/trunk/sound/core/rawmidi.c b/trunk/sound/core/rawmidi.c index eb68326c37d4..a7868ad4d530 100644 --- a/trunk/sound/core/rawmidi.c +++ b/trunk/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) {