]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: usbtest: fix NULL pointer dereference
authorAlan Stern <stern@rowland.harvard.edu>
Fri, 29 Sep 2017 14:54:24 +0000 (10:54 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 18 Nov 2017 10:30:40 +0000 (11:30 +0100)
commit19ab6908533107d0a18048a7d8262eb74f5c05cb
treebb8a01853182505478e22d85c600ab20b81fda36
parent6f086f306d1e3af9a43a1f5c188be0544d643ace
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