lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Date:	Thu, 28 Feb 2008 23:36:24 +0100
From:	"Jesper Juhl" <jesper.juhl@...il.com>
To:	"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>
Cc:	mm-commits@...r.kernel.org, mathieu.desnoyers@...ymtl.ca,
	"Linux Kernel Mailing List" <linux-kernel@...r.kernel.org>
Subject: Re: + markers-dont-risk-null-deref-in-marker-checkpatch-fixes.patch added to -mm tree

On 28/02/2008, akpm@...ux-foundation.org <akpm@...ux-foundation.org> wrote:
>
>  The patch titled
>      markers-dont-risk-null-deref-in-marker-checkpatch-fixes
>  has been added to the -mm tree.  Its filename is
>      markers-dont-risk-null-deref-in-marker-checkpatch-fixes.patch
>
<snip>
>  Subject: markers-dont-risk-null-deref-in-marker-checkpatch-fixes
>  From: Andrew Morton <akpm@...ux-foundation.org>
>

Andrew,  I very much do not agree with you and/or checkpatch here :

>  WARNING: braces {} are not necessary for single statement blocks
>  #34: FILE: kernel/marker.c:715:
>  +       if (!entry) {
>  +               goto end;
>  +       }
>
>  total: 0 errors, 1 warnings, 29 lines checked
>
>  ./patches/markers-dont-risk-null-deref-in-marker.patch has style problems, please review.  If any of these errors
>  are false positives report them to the maintainer, see
>  CHECKPATCH in MAINTAINERS.
>
>  Please run checkpatch prior to sending patches
>
>  Cc: Jesper Juhl <jesper.juhl@...il.com>
>  Cc: Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>
>  Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
>  ---
>
>   kernel/marker.c |    6 ++----
>   1 file changed, 2 insertions(+), 4 deletions(-)
>
>  diff -puN kernel/marker.c~markers-dont-risk-null-deref-in-marker-checkpatch-fixes kernel/marker.c
>  --- a/kernel/marker.c~markers-dont-risk-null-deref-in-marker-checkpatch-fixes
>  +++ a/kernel/marker.c
>  @@ -702,9 +702,8 @@ int marker_probe_unregister(const char *
>
>         mutex_lock(&markers_mutex);
>         entry = get_marker(name);
>  -       if (!entry) {
>  +       if (!entry)
>                 goto end;
>  -       }
>         if (entry->rcu_pending)
>                 rcu_barrier();
>         old = marker_entry_remove_probe(entry, probe, probe_private);
>  @@ -712,9 +711,8 @@ int marker_probe_unregister(const char *
>         marker_update_probes();         /* may update entry */
>         mutex_lock(&markers_mutex);
>         entry = get_marker(name);
>  -       if (!entry) {
>  +       if (!entry)
>                 goto end;
>  -       }
>         entry->oldptr = old;
>         entry->rcu_pending = 1;
>         /* write rcu_pending before calling the RCU callback */

While it is entirely true that the compiler has no need for the extra
{} they are very nice for human readers/editors of the code - and if
what's inside happens to be a macro, also potentially safer.

I left them in very much on purpose.

-- 
Jesper Juhl <jesper.juhl@...il.com>
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please      http://www.expita.com/nomime.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ