Mathias Nyman 80602b6b5a xhci: Fix null pointer dereference during S4 resume when resetting ep0
During device enumeration usb core resets endpoint 0 if the max packet
size value differs from the one read from the device descriptor.

usb core will additionally reset endpoint 0 during S4 resume, before
re-enumerating the device, if the device has a reset-resume flag set.

In this case the xhci device representation vdev may be lost due to
xHC restore error and re-initialization during S4 resume.

Make sure slot_id and vdev are valid before trying to re-configure max
packet size during endpoint 0 reset.
max packet size will be re-configured later during re-enumeration.

This fixes commit e34900f46cd6 ("xhci: Reconfigure endpoint 0 max packet
size only during endpoint reset") which is currently in usb-next,
on its way to 6.8

Fixes: e34900f46cd6 ("xhci: Reconfigure endpoint 0 max packet size only during endpoint reset")
Tested-by: Wendy Wang <wendy.wang@intel.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20231215125707.1732989-2-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-12-15 18:29:02 +01:00
..
2022-09-01 16:08:29 +02:00
2023-05-29 15:28:34 +01:00
2023-03-21 14:06:11 +01:00
2023-02-01 17:23:38 +01:00
2023-05-28 15:25:53 +01:00
2023-12-04 07:50:40 +01:00
2023-12-11 08:44:28 +01:00
2023-07-31 09:36:55 +02:00