]> git.baikalelectronics.ru Git - kernel.git/commit
USB: ftdi_sio: fix null deref at port probe
authorJohan Hovold <johan@kernel.org>
Thu, 5 Jun 2014 14:05:52 +0000 (16:05 +0200)
committerJohan Hovold <johan@kernel.org>
Mon, 23 Jun 2014 10:27:41 +0000 (12:27 +0200)
commit11be548d08e807f1347a6919cec6e2825ba83e86
treef507dc99db41054ead468c081c58427dff8080d2
parent0c3e8752edfedd079f992c2b304c0c9c38a3f28f
USB: ftdi_sio: fix null deref at port probe

Fix NULL-pointer dereference when probing an interface with no
endpoints.

These devices have two bulk endpoints per interface, but this avoids
crashing the kernel if a user forces a non-FTDI device to be probed.

Note that the iterator variable was made unsigned in order to avoid
a maybe-uninitialized compiler warning for ep_desc after the loop.

Fixes: f8fd2ba4c0f3 ("USB: ftdi_sio: fix hi-speed device packet size
calculation")

Reported-by: Mike Remski <mremski@mutualink.net>
Tested-by: Mike Remski <mremski@mutualink.net>
Cc: <stable@vger.kernel.org> # 2.6.31
Signed-off-by: Johan Hovold <johan@kernel.org>
drivers/usb/serial/ftdi_sio.c