]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
USB: serial: ftdi_sio: only allow valid event_char values
authorIan Abbott <abbotti@mev.co.uk>
Wed, 8 Mar 2017 16:03:00 +0000 (16:03 +0000)
committerJohan Hovold <johan@kernel.org>
Mon, 13 Mar 2017 15:55:41 +0000 (16:55 +0100)
commitd0559a2f294c9b50d7795a8362931f0db8953de1
tree0c3943246b8cd960371318dcf2bb9130a06feae0
parentdb9240662a44e1b7781c8dbf35631bcec7a369c6
USB: serial: ftdi_sio: only allow valid event_char values

The "event_char" device attribute value, when written, is interpreted as
an enable bit in bit 8, and an "event character" in bits 7 to 0.

Return an error -EINVAL for out-of-range values.  Use kstrtouint() to
parse the integer instead of the obsolete simple_strtoul().

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Johan Hovold <johan@kernel.org>
drivers/usb/serial/ftdi_sio.c