usb: usbtest: fix NULL pointer dereference
commit8cf061d919e2102d0de0379bafea6cce1405d786
authorAlan Stern <stern@rowland.harvard.edu>
Fri, 29 Sep 2017 14:54:24 +0000 (29 10:54 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 18 Nov 2017 10:22:24 +0000 (18 11:22 +0100)
treeaffe505805956dd8d0e1e2f78db536421dc2ea6f
parentddd95bc900ae5d2eed4fcfb3350360c87fd5b9df
usb: usbtest: fix NULL pointer dereference

commit 7c80f9e4a588f1925b07134bb2e3689335f6c6d8 upstream.

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 <stern@rowland.harvard.edu>
Reported-by: Andrey Konovalov <andreyknvl@google.com>
Tested-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Cc: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/misc/usbtest.c