Re: [PATCH] [IPv6]: Invalid semicolon after if statement
On Wed, 15 Aug 2007, David Miller wrote: From: Dave Jones [EMAIL PROTECTED] Date: Wed, 15 Aug 2007 19:52:20 -0400 On Wed, Aug 15, 2007 at 03:08:14PM -0700, David Miller wrote: From: Ilpo_Järvinen [EMAIL PROTECTED] Date: Thu, 16 Aug 2007 00:57:00 +0300 (EEST) A similar fix to netfilter from Eric Dumazet inspired me to look around a bit by using some grep/sed stuff as looking for this kind of bugs seemed easy to automate. This is one of them I found where it looks like this semicolon is not valid. Signed-off-by: Ilpo Järvinen [EMAIL PROTECTED] Yikes! Makes you want to audit the entire tree for these things :-))) Indeed. Here's another one. Signed-off-by: Dave Jones [EMAIL PROTECTED] That got fixed the other day and is the A similar fix to netfilter from Eric Dumazet Ilpo is reffering to above :) ...heh, when I said a bit, I meant that it took a very little effort to check over the whole tree... :-) ...I've already reported all four things one could find from whole tree with this cmd (to the relevant parties), so no need for you to redo the effort :-) : $ for i in `find . -name '*.[ch]'`; do echo $i; sed -n -e '/^\t*if *[(].*[)] *; *$/ N' -e '/^\(\t*\)if *[(].*[)] *; *\n\1\t/ p' $i; done | tee result ...Basically it checks if the next line has more indentation than the if line. ...Obviously it will work only if the code follows current CodingStyle in indentation. I'm currently experimenting with indent preprocessing step... ...but I'm not yet sure if I can pull something useful out from that too :-) ...Better cmdlines could be invented, e.g. by manually checking every if (); lines once one has first automated separation of them from if () do_smthg(); lines (I haven't learned myself how to easily count/work with parenthesis pairs in a cmdline, which seems necessary here)... -- i.
[PATCH] [IPv6]: Invalid semicolon after if statement
A similar fix to netfilter from Eric Dumazet inspired me to look around a bit by using some grep/sed stuff as looking for this kind of bugs seemed easy to automate. This is one of them I found where it looks like this semicolon is not valid. Signed-off-by: Ilpo Järvinen [EMAIL PROTECTED] --- net/ipv6/ipv6_sockglue.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c index d684639..761a910 100644 --- a/net/ipv6/ipv6_sockglue.c +++ b/net/ipv6/ipv6_sockglue.c @@ -820,7 +820,7 @@ static int ipv6_getsockopt_sticky(struct sock *sk, struct ipv6_txoptions *opt, return 0; len = min_t(unsigned int, len, ipv6_optlen(hdr)); - if (copy_to_user(optval, hdr, len)); + if (copy_to_user(optval, hdr, len)) return -EFAULT; return ipv6_optlen(hdr); } -- 1.5.0.6
Re: [PATCH] [IPv6]: Invalid semicolon after if statement
From: Ilpo_Järvinen [EMAIL PROTECTED] Date: Thu, 16 Aug 2007 00:57:00 +0300 (EEST) A similar fix to netfilter from Eric Dumazet inspired me to look around a bit by using some grep/sed stuff as looking for this kind of bugs seemed easy to automate. This is one of them I found where it looks like this semicolon is not valid. Signed-off-by: Ilpo Järvinen [EMAIL PROTECTED] Yikes! Makes you want to audit the entire tree for these things :-))) Patch applied, thanks a lot Ilpo! - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] [IPv6]: Invalid semicolon after if statement
On Wed, Aug 15, 2007 at 03:08:14PM -0700, David Miller wrote: From: Ilpo_Järvinen [EMAIL PROTECTED] Date: Thu, 16 Aug 2007 00:57:00 +0300 (EEST) A similar fix to netfilter from Eric Dumazet inspired me to look around a bit by using some grep/sed stuff as looking for this kind of bugs seemed easy to automate. This is one of them I found where it looks like this semicolon is not valid. Signed-off-by: Ilpo Järvinen [EMAIL PROTECTED] Yikes! Makes you want to audit the entire tree for these things :-))) Indeed. Here's another one. Signed-off-by: Dave Jones [EMAIL PROTECTED] diff --git a/net/netfilter/xt_u32.c b/net/netfilter/xt_u32.c index 74f9b14..bec4279 100644 --- a/net/netfilter/xt_u32.c +++ b/net/netfilter/xt_u32.c @@ -36,7 +36,7 @@ static bool u32_match_it(const struct xt_u32 *data, at = 0; pos = ct-location[0].number; - if (skb-len 4 || pos skb-len - 4); + if (skb-len 4 || pos skb-len - 4) return false; ret = skb_copy_bits(skb, pos, n, sizeof(n)); -- http://www.codemonkey.org.uk - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] [IPv6]: Invalid semicolon after if statement
From: Dave Jones [EMAIL PROTECTED] Date: Wed, 15 Aug 2007 19:52:20 -0400 On Wed, Aug 15, 2007 at 03:08:14PM -0700, David Miller wrote: From: Ilpo_Järvinen [EMAIL PROTECTED] Date: Thu, 16 Aug 2007 00:57:00 +0300 (EEST) A similar fix to netfilter from Eric Dumazet inspired me to look around a bit by using some grep/sed stuff as looking for this kind of bugs seemed easy to automate. This is one of them I found where it looks like this semicolon is not valid. Signed-off-by: Ilpo Järvinen [EMAIL PROTECTED] Yikes! Makes you want to audit the entire tree for these things :-))) Indeed. Here's another one. Signed-off-by: Dave Jones [EMAIL PROTECTED] That got fixed the other day and is the A similar fix to netfilter from Eric Dumazet Ilpo is reffering to above :) - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html