LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Fabian Frederick <fabf@skynet.be>
To: linux-kernel@vger.kernel.org
Cc: Fabian Frederick <fabf@skynet.be>,
Pablo Neira Ayuso <pablo@netfilter.org>,
Patrick McHardy <kaber@trash.net>,
Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>,
"David S. Miller" <davem@davemloft.net>,
netfilter-devel@vger.kernel.org, coreteam@netfilter.org,
netdev@vger.kernel.org
Subject: [PATCH 9/9 net-next] netfilter: replace if/BUG by BUG_ON
Date: Mon, 30 Mar 2015 23:13:17 +0200 [thread overview]
Message-ID: <1427749998-28464-9-git-send-email-fabf@skynet.be> (raw)
In-Reply-To: <1427749998-28464-1-git-send-email-fabf@skynet.be>
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
net/netfilter/nfnetlink_log.c | 3 +--
net/netfilter/xt_u32.c | 8 +++-----
2 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c
index 957b83a..409f5fb 100644
--- a/net/netfilter/nfnetlink_log.c
+++ b/net/netfilter/nfnetlink_log.c
@@ -577,8 +577,7 @@ __build_packet_message(struct nfnl_log_net *log,
nla->nla_type = NFULA_PAYLOAD;
nla->nla_len = size;
- if (skb_copy_bits(skb, 0, nla_data(nla), data_len))
- BUG();
+ BUG_ON(skb_copy_bits(skb, 0, nla_data(nla), data_len));
}
nlh->nlmsg_len = inst->skb->tail - old_tail;
diff --git a/net/netfilter/xt_u32.c b/net/netfilter/xt_u32.c
index a95b5034..5ff937d 100644
--- a/net/netfilter/xt_u32.c
+++ b/net/netfilter/xt_u32.c
@@ -38,8 +38,7 @@ static bool u32_match_it(const struct xt_u32 *data,
if (skb->len < 4 || pos > skb->len - 4)
return false;
- if (skb_copy_bits(skb, pos, &n, sizeof(n)) < 0)
- BUG();
+ BUG_ON(skb_copy_bits(skb, pos, &n, sizeof(n)) < 0);
val = ntohl(n);
nnums = ct->nnums;
@@ -65,9 +64,8 @@ static bool u32_match_it(const struct xt_u32 *data,
pos > skb->len - at - 4)
return false;
- if (skb_copy_bits(skb, at + pos, &n,
- sizeof(n)) < 0)
- BUG();
+ BUG_ON(skb_copy_bits(skb, at + pos, &n,
+ sizeof(n)) < 0);
val = ntohl(n);
break;
}
--
1.9.1
prev parent reply other threads:[~2015-03-30 21:14 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-30 21:13 [PATCH 1/9 net-next] ipv4: " Fabian Frederick
2015-03-30 21:13 ` [PATCH 2/9 net-next] net: core: " Fabian Frederick
2015-03-30 21:13 ` [PATCH 3/9 net-next] af_key: " Fabian Frederick
2015-03-30 21:13 ` [PATCH 4/9 net-next] ipv6: " Fabian Frederick
2015-03-31 3:50 ` YOSHIFUJI Hideaki
2015-03-31 15:17 ` David Miller
2015-04-03 20:02 ` Fabian Frederick
2015-03-30 21:13 ` [PATCH 5/9 net-next] xfrm: " Fabian Frederick
2015-03-30 21:13 ` [PATCH 6/9 net-next] af_packet: " Fabian Frederick
2015-03-30 21:13 ` [PATCH 7/9 net-next] sunrpc: " Fabian Frederick
2015-03-30 21:25 ` J. Bruce Fields
2015-03-31 19:00 ` Fabian Frederick
2015-03-31 19:11 ` Julia Lawall
2015-03-31 20:13 ` Fabian Frederick
2015-03-30 21:13 ` [PATCH 8/9 net-next] rxrpc: " Fabian Frederick
2015-03-30 21:13 ` Fabian Frederick [this message]
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=1427749998-28464-9-git-send-email-fabf@skynet.be \
--to=fabf@skynet.be \
--cc=coreteam@netfilter.org \
--cc=davem@davemloft.net \
--cc=kaber@trash.net \
--cc=kadlec@blackhole.kfki.hu \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
--subject='Re: [PATCH 9/9 net-next] netfilter: replace if/BUG by BUG_ON' \
/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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).