USB: serial: spcp8x5: fix NULL-deref at open
authorJohan Hovold <johan@kernel.org>
Tue, 3 Jan 2017 15:40:02 +0000 (16:40 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 16 Mar 2017 02:18:38 +0000 (02:18 +0000)
commit96f915ee1f5a3854c6a0a35d20efc86b4fd3d4f9
treef7dba608eb5b177e49916bebefe52c0e81f9c051
parentad5f2860191be1040a38caec5eac879d084adfa4
USB: serial: spcp8x5: fix NULL-deref at open

commit cc0909248258f679c4bb4cd315565d40abaf6bc6 upstream.

Fix NULL-pointer dereference in open() should the device lack the
expected endpoints:

Unable to handle kernel NULL pointer dereference at virtual address 00000030
...
PC is at spcp8x5_open+0x30/0xd0 [spcp8x5]

Fixes: 619a6f1d1423 ("USB: add usb-serial spcp8x5 driver")
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/spcp8x5.c