USB: serial: keyspan_pda: verify endpoints at probe
authorJohan Hovold <johan@kernel.org>
Tue, 3 Jan 2017 15:39:48 +0000 (16:39 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 16 Mar 2017 02:18:36 +0000 (02:18 +0000)
commit4372f2e6a75ef669921e140a97f53a68b701ed1d
treea6666fc081ad8ded64d3ce2ddebba38d57957a87
parenta318411d01c7bac770dbfbcbd21aa40bfe91c205
USB: serial: keyspan_pda: verify endpoints at probe

commit 5d9b0f859babe96175cd33d7162a9463a875ffde upstream.

Check for the expected endpoints in attach() and fail loudly if not
present.

Note that failing to do this appears to be benign since da280e348866
("USB: keyspan_pda: clean up write-urb busy handling") which prevents a
NULL-pointer dereference in write() by never marking a non-existent
write-urb as free.

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/keyspan_pda.c