USB: serial: mos7840: fix NULL-deref at open
commitbd52ddb0996af221523f7572840c6875bc0d4b8b
authorJohan Hovold <johan@kernel.org>
Tue, 3 Jan 2017 15:39:55 +0000 (3 16:39 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Jan 2017 10:39:16 +0000 (12 11:39 +0100)
treef5a65d0480ffe8f0a46906c29a218e4a5452b33f
parent9de856caff86c18f092a03a16f06f1422796be94
USB: serial: mos7840: fix NULL-deref at open

commit 5c75633ef751dd4cd8f443dc35152c1ae563162e 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 mos7840_open+0x88/0x8dc [mos7840]

Note that we continue to treat the interrupt-in endpoint as optional for
now.

Fixes: 3f5429746d91 ("USB: Moschip 7840 USB-Serial Driver")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/serial/mos7840.c