Motzkin paths are integer lattice paths that use steps \(U=(1,1)\) , \(L=(1,0)\) and \(D=(1,-1)\) and stay weakly above the line \(y=0\) . An m-generalized Motzkin path is a lattice path on the upper half-plane that use steps \(U=(1,1)\) and \(D_i=(1+i,1-i)\) for every positive integer \( i \le m\) . We denote by \(M^{(m)}_{n,k}\) the number of m-generalized Motzkin paths of length \(2n-k\) and height k, and by \(G^{(m)}_{n,k}\) the number of free m-generalized Motzkin paths of length \(2n-k\) and height k. We will show that the triangles \((M^{(m)}_{n,k})_{n,k\in \mathbb {N}}\) and \((G^{(m)}_{n,k})_{n,k \in \mathbb {N}}\) are Riordan arrays, and we provide a Chung–Feller property for the m-generalized Motzkin paths by investigating the relationship between these two Riordan arrays. We further consider the free m-generalized Motzkin paths where certain steps are allowed to be colored, and present a bijective proof for the Chung–Feller property.