yam: integer underflow in yam_ioctl()
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 14 Oct 2013 12:28:38 +0000 (15:28 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 17 Oct 2013 19:53:09 +0000 (15:53 -0400)
We cap bitrate at YAM_MAXBITRATE in yam_ioctl(), but it could also be
negative.  I don't know the impact of using a negative bitrate but let's
prevent it.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/yam.h

index 7fe28228b2742efc0c9eb69c7bbc866f0194ef19..512cdc2fb80f40f99bb1b09fe1d0d4dcfeab345c 100644 (file)
@@ -77,6 +77,6 @@ struct yamdrv_ioctl_cfg {
 
 struct yamdrv_ioctl_mcs {
        int cmd;
-       int bitrate;
+       unsigned int bitrate;
        unsigned char bits[YAM_FPGA_SIZE];
 };