Find the minimum gap (difference) between adjacent elements in a linked list
You don't need to store the whole previous node, just the value. Also, you can replace checking whether the gap is smaller with min, although it's mainly a matter of taste. And p is a rather opaque variable name

public int minGap() {
    if (front == null || front.next == null) {
        return 0;
    }
    int minGap = Integer.MAX_VALUE;
    int lastValue = front.data;
    ListNode currentNode = front.next;
    while (currentNode != null) {
       minGap = min(minGap, currentNode.data-lastValue);
       lastValue = currentNode.value;
       currentNode = currentNode.next;
    }
    return minGap;
}