OSDN Git Service

xhci: don't create endpoint debugfs entry before ring buffer is set.
authorMathias Nyman <mathias.nyman@linux.intel.com>
Fri, 18 Sep 2020 13:17:51 +0000 (16:17 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 20 Sep 2020 14:18:00 +0000 (16:18 +0200)
commit167657a1bb5fcde53ac304ce6c564bd90a2f9185
tree85fee499b045f5c18d0b8792e4e8de142612cc07
parentedc649a8234118f80869ca860a0048821a4898e6
xhci: don't create endpoint debugfs entry before ring buffer is set.

Make sure xHC completes the configure endpoint command and xhci driver
sets the ring pointers correctly before we create the user readable
debugfs file.

In theory there was a small gap where a user could have read the
debugfs file and cause a NULL pointer dereference error as ring
pointer was not yet set, in practise we want this change to simplify
the upcoming streams debugfs support.

Fixes: 02b6fdc2a153 ("usb: xhci: Add debugfs interface for xHCI driver")
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20200918131752.16488-10-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci.c