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

xhci: Fix invalid loop check in xhci_free_tt_info()



xhci_free_tt_info() may access the invalid memory when it removes the
last entry but the list is not empty.  Then tt_next reaches to the
list head but it still tries to check the tt_info of that entry.

This patch fixes the bug and cleans up the messy code by rewriting
with a simple list_for_each_entry_safe().

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 e25e62ae
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