[PATCH 6.4 686/800] octeontx2-af: Add validation before accessing cgx and lmac