[IA64] pci_br, fix infinite loop in find_free_ate()
[IA64] pci_br, fix infinite loop in find_free_ate()

When
* there is almost out of ates
* one asks for more than one ate
* there are some available at the end of ate array
then the inner for loop will end without incrementing 'index'. This
means the outer loop will start at the same point finding it's available
and runs the inner loop again from the same index. This repeats forever.

Hence make sure we check we were at the end of ate array and return
an error in such case.

Signed-off-by: Jiri Slaby <aeaaaa09d9a5fac7c38743ea79aa4bb8ffb08290@gmail.com>
Cc: Fenghua Yu <94fe9a7ec8ff966c1952fe98e39b5ae3a7477695@intel.com>
Found-by: Jeff Mahoney <5459ed423adecc5a7fe2249dd619058acc25c497@novell.com>
Signed-off-by: Tony Luck <e7984595ec0368ff920a7b3521dc7093683f6f26@intel.com>

TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs