From: Wei Yongjun <yjwei@cn.fujitsu.com>
To: Patrick McHardy <kaber@trash.net>
Cc: netfilter@vger.kernel.org, Wei Yongjun <yjwei@cn.fujitsu.com>
Subject: [PATCH] netfilter: remove some pointless conditionals before kfree_skb()
Date: Wed, 25 Feb 2009 18:44:06 +0800 [thread overview]
Message-ID: <49A520F6.1010404@cn.fujitsu.com> (raw)
Remove some pointless conditionals before kfree_skb().
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
---
net/decnet/netfilter/dn_rtmsg.c | 3 +--
net/ipv6/netfilter/nf_conntrack_reasm.c | 3 +--
net/netfilter/nfnetlink_queue.c | 3 +--
3 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/net/decnet/netfilter/dn_rtmsg.c b/net/decnet/netfilter/dn_rtmsg.c
index 6d2bd32..17cbc4c 100644
--- a/net/decnet/netfilter/dn_rtmsg.c
+++ b/net/decnet/netfilter/dn_rtmsg.c
@@ -53,8 +53,7 @@ static struct sk_buff *dnrmg_build_message(struct sk_buff *rt_skb, int *errp)
return skb;
nlmsg_failure:
- if (skb)
- kfree_skb(skb);
+ kfree_skb(skb);
*errp = -ENOMEM;
if (net_ratelimit())
printk(KERN_ERR "dn_rtmsg: error creating netlink message\n");
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c
index ed4d79a..37f7954 100644
--- a/net/ipv6/netfilter/nf_conntrack_reasm.c
+++ b/net/ipv6/netfilter/nf_conntrack_reasm.c
@@ -112,8 +112,7 @@ static unsigned int nf_hashfn(struct inet_frag_queue *q)
static void nf_skb_free(struct sk_buff *skb)
{
- if (NFCT_FRAG6_CB(skb)->orig)
- kfree_skb(NFCT_FRAG6_CB(skb)->orig);
+ kfree_skb(NFCT_FRAG6_CB(skb)->orig);
}
/* Memory Tracking Functions. */
diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c
index 8c86011..6f4c970 100644
--- a/net/netfilter/nfnetlink_queue.c
+++ b/net/netfilter/nfnetlink_queue.c
@@ -379,8 +379,7 @@ nfqnl_build_packet_message(struct nfqnl_instance *queue,
nlmsg_failure:
nla_put_failure:
- if (skb)
- kfree_skb(skb);
+ kfree_skb(skb);
if (net_ratelimit())
printk(KERN_ERR "nf_queue: error creating packet message\n");
return NULL;
--
1.5.3.8
reply other threads:[~2009-02-25 10:44 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49A520F6.1010404@cn.fujitsu.com \
--to=yjwei@cn.fujitsu.com \
--cc=kaber@trash.net \
--cc=netfilter@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.