Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d2a0adf3 authored by Sridhar Ancha's avatar Sridhar Ancha Committed by Gerrit - the friendly Code Review server
Browse files

net: netfilter: Updating conntract pointer NULL check



The conntrack (ct) NULL check was done after we have accessed the
ct pointer. Moving the NULL check before accessing any ct related
parameters.

Change-Id: I8334728747c35ed21a8c0420add577bc3135a3bd
Signed-off-by: default avatarSridhar Ancha <sancha@codeaurora.org>
parent b2b64139
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1916,6 +1916,9 @@ static int sip_help_tcp(struct sk_buff *skb, unsigned int protoff,
	if (dataoff >= skb->len)
		return NF_ACCEPT;

	if (!ct)
		return NF_DROP;

	nf_ct_refresh(ct, skb, sip_timeout * HZ);

	if (unlikely(skb_linearize(skb)))
@@ -1934,9 +1937,6 @@ static int sip_help_tcp(struct sk_buff *skb, unsigned int protoff,
	oldlen1 = skb->len - protoff;
	dataoff_orig = dataoff;

	if (!ct)
		return NF_DROP;

	dir = CTINFO2DIR(ctinfo);

sip_header_process: