From: Jan Beulich Date: Thu, 13 Mar 2008 09:13:30 +0000 (+0000) Subject: avoid endless loops in lib/swiotlb.c X-Git-Tag: v2.6.25-rc6~18 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b15a3891c916f32a29832886a053a48be2741d4d;p=pandora-kernel.git avoid endless loops in lib/swiotlb.c Commit 681cc5cd3efbeafca6386114070e0bfb5012e249 ("iommu sg merging: swiotlb: respect the segment boundary limits") introduced two possibilities for entering an endless loop in lib/swiotlb.c: - if max_slots is zero (possible if mask is ~0UL) - if the number of slots requested fits into a swiotlb segment, but is too large for the part of a segment which remains after considering offset_slots This fixes them Signed-off-by: Jan Beulich Cc: FUJITA Tomonori Cc: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed