spin_lock_bh(&nf_conntrack_lock);
- list_for_each_safe(sip_node_list, sip_node_save_list,
- &ct->sip_segment_list)
- {
- sip_node = list_entry(sip_node_list, struct sip_list, list);
- pr_debug("freeing item in the SIP list\n");
- list_del(&(sip_node->list));
- kfree(sip_node);
- }
+ if (ct->sip_segment_list.next != NULL)
+ list_for_each_safe(sip_node_list, sip_node_save_list,
+ &ct->sip_segment_list) {
+ sip_node = list_entry(sip_node_list,
+ struct sip_list, list);
+ list_del(&sip_node->list);
+ kfree(sip_node);
+ }
/* Expectations will have been removed in clean_from_lists,
* except TFTP can create an expectation on the first packet,