> while ((int) priv->tx_tail - (int) priv->tx_head < 0) { > > seems to rely on integer overflow which seems to be > undefined behaviour. tx_tail and tx_head are unsigned, and overflow is defined for unsigned integers. - R.