USB: serial: mos7840: fix NULL-deref at open
authorJohan Hovold <johan@kernel.org>
Tue, 3 Jan 2017 15:39:55 +0000 (16:39 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 7 Jun 2017 22:46:51 +0000 (00:46 +0200)
commite514b7137a922e048b67bd5918526b25be5707b5
treed38b350568247a5c38b0c532cd5c912a7e61e790
parent810fb7b7bf8f3ccc4df6ef9a7c05d0a52a9d05ef
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: Willy Tarreau <w@1wt.eu>
drivers/usb/serial/mos7840.c