diff --git a/net/netfilter/nf_queue.c b/net/netfilter/nf_queue.c index 3a6fd77..27a701f 100644 --- a/net/netfilter/nf_queue.c +++ b/net/netfilter/nf_queue.c @@ -130,10 +130,8 @@ static int __nf_queue(struct sk_buff *skb, goto err_unlock; afinfo = nf_get_afinfo(pf); - if (!afinfo) - goto err_unlock; - - entry = kmalloc(sizeof(*entry) + afinfo->route_key_size, GFP_ATOMIC); + entry = kmalloc(sizeof(*entry) + afinfo ? afinfo->route_key_size : 0, + GFP_ATOMIC); if (!entry) goto err_unlock; @@ -169,7 +167,8 @@ static int __nf_queue(struct sk_buff *skb, dev_hold(physoutdev); } #endif - afinfo->saveroute(skb, entry); + if (afinfo) + afinfo->saveroute(skb, entry); status = qh->outfn(entry, queuenum); rcu_read_unlock(); @@ -247,7 +246,7 @@ void nf_reinject(struct nf_queue_entry *entry, unsigned int verdict) if (verdict == NF_ACCEPT) { afinfo = nf_get_afinfo(entry->pf); - if (!afinfo || afinfo->reroute(skb, entry) < 0) + if (afinfo && afinfo->reroute(skb, entry) < 0) verdict = NF_DROP; }