Skip to content
Commit 32f1d2c5 authored by Takashi Iwai's avatar Takashi Iwai Committed by Sarah Sharp
Browse files

xhci: Don't free endpoints in xhci_mem_cleanup()



This patch fixes a few issues introduced in the recent fix
[f8a9e72d: USB: fix resource leak in xhci power loss path]

- The endpoints listed in bw table are just links and each entry is an
 array member of dev->eps[].  But the commit above adds a kfree() call
 to these instances, and thus it results in memory corruption.

- It clears only the first entry of rh_bw[], but there can be multiple
  ports.

- It'd be safer to clear the list_head of ep as well, not only
  removing from the list, as it's checked in
  xhci_discover_or_reset_device().

This patch should be backported to kernels as old as 3.2, that contain
the commit 839c817c "xhci: Store
information about roothubs and TTs."

Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
Reviewed-by: default avatarOliver Neukum <oneukum@suse.de>
Cc: <stable@vger.kernel.org>
parent 46ed8f00
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment