Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

yam: integer underflow in yam_ioctl()

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>

authored by

Dan Carpenter and committed by
David S. Miller
9e5f1721 dbbd2ad8

+1 -1
+1 -1
include/linux/yam.h
··· 77 77 78 78 struct yamdrv_ioctl_mcs { 79 79 int cmd; 80 - int bitrate; 80 + unsigned int bitrate; 81 81 unsigned char bits[YAM_FPGA_SIZE]; 82 82 };