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] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 18 Jan 2013 20:13:07 +0000
From:	Russell King - ARM Linux <linux@....linux.org.uk>
To:	Linus Walleij <linus.walleij@...ricsson.com>
Cc:	linux-kernel@...r.kernel.org,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	"Rafael J. Wysocki" <rjw@...k.pl>,
	Anmar Oueja <anmar.oueja@...aro.org>,
	Linus Walleij <linus.walleij@...aro.org>,
	Felipe Balbi <balbi@...com>, Benoit Cousson <b-cousson@...com>,
	Dmitry Torokhov <dmitry.torokhov@...il.com>,
	Thomas Petazzoni <thomas.petazzoni@...e-electrons.com>,
	Mitch Bradley <wmb@...mworks.com>,
	Ulf Hansson <ulf.hansson@...aro.org>,
	Jean-Christophe PLAGNIOL-VILLARD <plagnioj@...osoft.com>,
	Rickard Andersson <rickard.andersson@...ricsson.com>
Subject: Re: [PATCH v3] drivers/pinctrl: grab default handles from device
	core

On Fri, Jan 18, 2013 at 04:08:48PM +0100, Linus Walleij wrote:
> - Abstain from using IS_ERR_OR_NULL() in the driver core,
>   Russell recently sent a patch to remove it. Handle the
>   NULL case explicitly even though it's a bogus case.

Hmmmmmmmm... I assume you're talking about this:

> +	p = create_pinctrl(dev);
> +	if (p && !IS_ERR(p))
> +		kref_init(&p->users);
> +	return p;

which is... interesting.  In mainline currently, the version I see there
never returns NULL - it either returns an err pointer or a real pointer.

Next thing though is...

create_pinctrl adds the struct pinctrl onto the global list, and then you
intialize it here, which is an interesting sequence.  It's safe at the
moment because everything here is operating under a mutex, but it's a
little obscure.

Is there a reason not to initialize p->users inside create_pinctrl() ?
--
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