netfilter: contrack: Null pointer check is added

Prior to null pointer check, SIP node was deleted from the list
a null pointer check is added to confront the exception.

Change-Id: Ia12fa468eed7d1a91fad96840fa27cb0e4e208a8
Acked-by: Vinisha Varre <vvarre@qti.qualcomm.com>
Signed-off-by: Paras Singh Jain <parassin@codeaurora.org>
This commit is contained in:
Paras Singh Jain 2017-01-11 16:30:00 +05:30
commit eb11987e63

View file

@ -647,12 +647,15 @@ destroy_conntrack(struct nf_conntrack *nfct)
#ifdef CONFIG_NF_CONNTRACK_SIP_SEGMENTATION
pr_debug("freeing item in the SIP list\n");
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);
}
if (ct->sip_segment_list.next)
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);
}
#endif
/* Expectations will have been removed in clean_from_lists,
* except TFTP can create an expectation on the first packet,