[PATCH 5.15 325/532] octeontx2-af: Add validation before accessing cgx and lmac