[alsa-devel] [patch v2] ALSA: rawmidi: fix the get next midi device ioctl

Clemens Ladisch clemens at ladisch.de
Thu Sep 9 09:44:52 CEST 2010

Dan Carpenter wrote:
> If we pass in a device which is higher than SNDRV_RAWMIDI_DEVICES then
> this function just returns device + 1 which isn't helpful.  I've
> modified it to return -EINVAL instead.
> Also Smatch complains because the "device + 1" could be an integer
> overflow.  It's harmless,

It would result in device==INT_MIN, which would make the while loop go
through 2^31 values before finding the first MIDI device.


More information about the Alsa-devel mailing list