USB: serial: omninet: fix NULL-derefs at open and disconnect
authorJohan Hovold <johan@kernel.org>
Tue, 3 Jan 2017 15:39:58 +0000 (16:39 +0100)
committerJohan Hovold <johan@kernel.org>
Wed, 4 Jan 2017 09:37:21 +0000 (10:37 +0100)
commita5bc01949e3b19d8a23b5eabc6fc71bb50dc820e
tree7a2a47465f5955c33297103977722f552760e465
parent472d7e55d559aa1cbf58c73b14fcfc4651b1a9f5
USB: serial: omninet: fix NULL-derefs at open and disconnect

Fix NULL-pointer dereferences at open() and disconnect() should the
device lack the expected bulk-out endpoints:

Unable to handle kernel NULL pointer dereference at virtual address 000000b4
...
[c0170ff0>] (__lock_acquire) from [<c0172f00>] (lock_acquire+0x108/0x264)
[<c0172f00>] (lock_acquire) from [<c06a5090>] (_raw_spin_lock_irqsave+0x58/0x6c)
[<c06a5090>] (_raw_spin_lock_irqsave) from [<c0470684>] (tty_port_tty_set+0x28/0xa4)
[<c0470684>] (tty_port_tty_set) from [<bf08d384>] (omninet_open+0x30/0x40 [omninet])
[<bf08d384>] (omninet_open [omninet]) from [<bf07c118>] (serial_port_activate+0x68/0x98 [usbserial])

Unable to handle kernel NULL pointer dereference at virtual address 00000234
...
[<bf01f418>] (omninet_disconnect [omninet]) from [<bf0016c0>] (usb_serial_disconnect+0xe4/0x100 [usbserial])

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
drivers/usb/serial/omninet.c