• Al Viro's avatar
    [PATCH] idmouse cleanup and overflow fix · 018a2cdf
    Al Viro authored
    switched to simple_read_from_buffer(), killed broken use of min().
    Incidentally, that use of min() had been fixed once, only to be
    reintroduced in commit 4244f724:
    
        [PATCH] USB: upgrade of the idmouse driver
    
    [snip]
    -       if (count > IMGSIZE - *ppos)
    -               count = IMGSIZE - *ppos;
    +       count = min ((loff_t)count, IMGSIZE - (*ppos));
    
    Note the lovely use of cast to shut the warning about misuse of min()
    up...
    Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    018a2cdf
idmouse.c 11.5 KB