USB: serial: kobil_sct: fix NULL-deref in write
authorJohan Hovold <johan@kernel.org>
Tue, 3 Jan 2017 15:39:49 +0000 (16:39 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 16 Mar 2017 02:18:36 +0000 (02:18 +0000)
commita22d4c0086f61db0b46d84760fd072d6fc0b58bb
tree51e8ee13240df94b2fcb52cfea1705badbe79ea3
parent4372f2e6a75ef669921e140a97f53a68b701ed1d
USB: serial: kobil_sct: fix NULL-deref in write

commit 21ce57840243c7b70fbc1ebd3dceeb70bb6e9e09 upstream.

Fix NULL-pointer dereference in write() should the device lack the
expected interrupt-out endpoint:

Unable to handle kernel NULL pointer dereference at virtual address 00000054
...
PC is at kobil_write+0x144/0x2a0 [kobil_sct]

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Johan Hovold <johan@kernel.org>
[bwh: Backported to 3.2: add this check to the existing
 usb_serial_driver::attach implementation]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/usb/serial/kobil_sct.c