[PATCH 5.18 510/879] net: stmmac: fix out-of-bounds access in a selftest