[PATCH 6.1 495/591] octeontx2-af: Add validation before accessing cgx and lmac