From: Joerg Roedel Date: Tue, 5 Aug 2014 15:50:15 +0000 (+0200) Subject: iommu/amd: Fix cleanup_domain for mass device removal X-Git-Tag: omap-for-v3.17/fixes-against-rc2~26^2~1 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b29d3c6510407d91786c1cf9183ff4debb3473a;p=pandora-kernel.git iommu/amd: Fix cleanup_domain for mass device removal When multiple devices are detached in __detach_device, they are also removed from the domains dev_list. This makes it unsafe to use list_for_each_entry_safe, as the next pointer might also not be in the list anymore after __detach_device returns. So just repeatedly remove the first element of the list until it is empty. Cc: stable@vger.kernel.org Tested-by: Marti Raudsepp Signed-off-by: Joerg Roedel --- Reading git-diff-tree failed