]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
xhci: zero usb device slot_id member when disabling and freeing a xhci slot
authorMathias Nyman <mathias.nyman@linux.intel.com>
Fri, 16 Mar 2018 14:33:01 +0000 (16:33 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 14 Aug 2018 10:28:42 +0000 (12:28 +0200)
commit2ff5ab4a1424d8ad1f1bc207610ed6c7a554aa9c
tree1ebb7e010d8841aa27f5b074d0bb7618bcddf56a
parent43744a698c92a3326f94af5a59f894e3da82e1b2
xhci: zero usb device slot_id member when disabling and freeing a xhci slot

BugLink: http://bugs.launchpad.net/bugs/1783418
[ Upstream commit a400efe455f7b61ac9a801ac8d0d01f8c8d82dd5 ]

set udev->slot_id to zero when disabling and freeing the xhci slot.
Prevents usb core from calling xhci with a stale slot id.

xHC controller may be reset during resume to recover from some error.
All slots are unusable as they are disabled and freed.
xhci driver starts slot enumeration again from 1 in the order they are
enabled. In the worst case a stale udev->slot_id for one device matches
a newly enabled slot_id for a different device, causing us to
perform a action on the wrong device.

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/usb/host/xhci-mem.c