Re: [patch v2] ALSA: rawmidi: fix the get next midi device ioctl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep 09, 2010 at 09:44:52AM +0200, Clemens Ladisch wrote:
> 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.
> 

Oh crap.  You're right.  For some reason I got mixed up.

regards,
dan carpenter

> 
> Regards,
> Clemens
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux