mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-01 22:54:01 +00:00
stm class: Fix an endless loop in channel allocation
commita1d75dad3a
upstream. There is a bug in the channel allocation logic that leads to an endless loop when looking for a contiguous range of channels in a range with a mixture of free and occupied channels. For example, opening three consequtive channels, closing the first two and requesting 4 channels in a row will trigger this soft lockup. The bug is that the search loop forgets to skip over the range once it detects that one channel in that range is occupied. Restore the original intent to the logic by fixing the omission. Signed-off-by: Zhi Jin <zhi.jin@intel.com> Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Fixes:7bd1d4093c
("stm class: Introduce an abstraction for System Trace Module devices") CC: stable@vger.kernel.org # v4.4+ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
ffe5a99203
commit
03750aa544
1 changed files with 3 additions and 0 deletions
|
@ -252,6 +252,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;
|
||||
|
|
Loading…
Reference in a new issue