From afa7310e9cf81fe7370fda660a174d5fa90722fc Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Wed, 15 Aug 2012 11:55:30 +1000 Subject: [PATCH] If there are more devices than nDevs, don't iterate over them as they may overwrite devices mapped below that with the mapping option. --- adl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/adl.c b/adl.c index cd977f25..aa22002b 100644 --- a/adl.c +++ b/adl.c @@ -339,6 +339,9 @@ void init_adl(int nDevs) } } + if (devices > nDevs) + devices = nDevs; + for (gpu = 0; gpu < devices; gpu++) { struct gpu_adl *ga; int iAdapterIndex;