usb: usbtest: fix NULL pointer dereference
authorAlan Stern <[email protected]>
Fri, 29 Sep 2017 14:54:24 +0000 (10:54 -0400)
committerFelipe Balbi <[email protected]>
Wed, 11 Oct 2017 10:15:11 +0000 (13:15 +0300)
commit7c80f9e4a588f1925b07134bb2e3689335f6c6d8
tree97cce111e80f00c281eb38467c00c4907481182b
parentff74745e6d3d97a865eda8c1f3fd29c13b79f0cc
usb: usbtest: fix NULL pointer dereference

If the usbtest driver encounters a device with an IN bulk endpoint but
no OUT bulk endpoint, it will try to dereference a NULL pointer
(out->desc.bEndpointAddress).  The problem can be solved by adding a
missing test.

Signed-off-by: Alan Stern <[email protected]>
Reported-by: Andrey Konovalov <[email protected]>
Tested-by: Andrey Konovalov <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
drivers/usb/misc/usbtest.c