[PATCH 4.19 010/280] stm class: Fix an endless loop in channel allocation