stm class: Fix an endless loop in channel allocation
[linux-2.6-microblaze.git] / drivers / hwtracing / stm / core.c
index 93ce3aa..c80b064 100644 (file)
@@ -244,6 +244,9 @@ static int find_free_channels(unsigned long *bitmap, unsigned int start,
                        ;
                if (i == width)
                        return pos;
+
+               /* step over [pos..pos+i) to continue search */
+               pos += i;
        }
 
        return -1;