Determine if an NFA accepts infinite language in polynomial time
Your algorithm is incorrect.  Think about the minimal DFA for $ab^*c$.

Related: Do self-loops in DFA cause infinite languages?, Do all DFA&#39;s containing an &quot;accepting path containing a cycle&quot; accept infinite languages?.