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]
Message-ID: <20150805165020.GB3603@dtor-ws>
Date:	Wed, 5 Aug 2015 09:50:20 -0700
From:	Dmitry Torokhov <dmitry.torokhov@...il.com>
To:	Javi Merino <javi.merino@....com>
Cc:	Eduardo Valentin <edubezval@...il.com>,
	Zhang Rui <rui.zhang@...el.com>,
	Lukasz Majewski <l.majewski@...sung.com>,
	Peter Feuerer <peter@...e.net>,
	Sascha Hauer <s.hauer@...gutronix.de>,
	Punit Agrawal <Punit.Agrawal@....com>,
	"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] thermal: power_allocator: do not use devm* interfaces

On Wed, Aug 05, 2015 at 09:29:11AM +0100, Javi Merino wrote:
> On Tue, Aug 04, 2015 at 05:33:40PM +0100, Dmitry Torokhov wrote:
> > The code in question is called outside of standard driver
> > probe()/remove() callbacks and thus will not benefit from use of devm*
> > infrastructure.
> > 
> > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@...il.com>
> 
> We added the devm* calls because Eduardo asked for them in the review.
> I don't have a strong opinion regarding this, I'll leave the decision
> to Eduardo.

I tried to look for his reasons, if any, but even in earliest posted
versions use devm* for allocating memory

I guess this is one of examples of devm* usage in wrong context. Given
that you, as you have to, because this is not a device driver, manually
freeing that memory with devm_kfree(), the only thing that devm_kzalloc
and friends buy you here is extra memory allocations for devres
structures and few extra cycles for maintaining them.

Thanks.

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