This is what we called as loop in link list.
To find out loop in link list follow the steps.
take two pointers, pointing to start of link list.
while(first node != NULL && second node !=NULL)
{
advance first pointer with one node
advance first pointer with two node
if(first node == second node)
{
here you can say that, there is loop in link list
break
}
}
That's not going to work.
A loop in a linked list is when more than one node points at a second node.
What to have to do is start going through the list keeping a list of the current node addresses. If any node next address points to any address in the address list, you have a loop.
Before this, however, fix your linked list code.
I assume you are using C. If you ae using C++ you should be using the list template instead of re-inventing the wheel.