usb: musb: trace: fix NULL pointer dereference in musb_g_tx()
authorBin Liu <b-liu@ti.com>
Mon, 30 Apr 2018 16:20:54 +0000 (11:20 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 May 2018 07:51:55 +0000 (09:51 +0200)
commit87fa7da673b4e8911cf0a36a270dc247e558930e
tree247fc1990a401591156c4e7274d58d364170ece3
parent303e99bde8dcb6beaa6be738e025f9f9dd2703f1
usb: musb: trace: fix NULL pointer dereference in musb_g_tx()

commit 9aea9b6cc78d2b99b23d84fb2e0bc6e464c6569e upstream.

The usb_request pointer could be NULL in musb_g_tx(), where the
tracepoint call would trigger the NULL pointer dereference failure when
parsing the members of the usb_request pointer.

Move the tracepoint call to where the usb_request pointer is already
checked to solve the issue.

Fixes: fc78003e5345 ("usb: musb: gadget: add usb-request tracepoints")
Cc: stable@vger.kernel.org # v4.8+
Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/musb/musb_gadget.c