[PATCH 4.4 153/230] stm class: Fix an endless loop in channel allocation