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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 07 May 2014 10:54:46 -0700
From:	Joe Perches <joe@...ches.com>
To:	Fabian Frederick <fabf@...net.be>
Cc:	linux-kernel <linux-kernel@...r.kernel.org>,
	Ananth N Mavinakayanahalli <ananth@...ibm.com>,
	akpm <akpm@...ux-foundation.org>
Subject: Re: [PATCH 1/1] kernel/kprobes.c: convert printk to pr_foo()

On Tue, 2014-05-06 at 19:12 +0200, Fabian Frederick wrote:

> diff --git a/kernel/kprobes.c b/kernel/kprobes.c
[]
> @@ -1385,7 +1387,7 @@ static struct kprobe * __kprobes __get_valid_kprobe(struct kprobe *p)
>  	if (p != ap) {
>  		list_for_each_entry_rcu(list_p, &ap->list, list)
>  			if (list_p == p)
> -			/* kprobe p is a valid probe */
> +				/* kprobe p is a valid probe */
>  				goto valid;
>  		return NULL;
>  	}

Perhaps this would be more readable as:

	/* Make sure p is a valid probe */
	if (p != ap) {
		list_for_each_entry_rcu(list_p, &ap->list, list) {
			if (list_p == p)
				goto valid;
		}
		return NULL;
	}

or maybe the function could be written
without the goto. something like:

static struct kprobe *__get_valid_kprobe(struct kprobe *p)
{
	struct kprobe *ap, *list_p;

	ap = get_kprobe(p->addr);
	if (unlikely(!ap))
		return NULL;

	if (p == ap)
		return ap;

	/* Make sure p is a valid probe */
	list_for_each_entry_rcu(list_p, &ap->list, list) {
		if (list_p == p)
			return ap;
	}

	return NULL;
}


--
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