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: <1381294767.2040.5.camel@joe-AO722>
Date:	Tue, 08 Oct 2013 21:59:27 -0700
From:	Joe Perches <joe@...ches.com>
To:	"sangjung.woo" <sangjung.woo@...sung.com>
Cc:	Alessandro Rubini <rubini@...dd.com>,
	Russell King <rmk+kernel@....linux.org.uk>,
	rtc-linux@...glegroups.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] rtc: pl030: Use devm_kzalloc() instead of kmalloc()

On Wed, 2013-10-09 at 13:36 +0900, sangjung.woo wrote:
> On 10/09/2013 01:07 PM, Joe Perches wrote:
> > On Wed, 2013-10-09 at 13:00 +0900, Sangjung Woo wrote:
> >> In order to be free automatically and make the cleanup paths more
> >> simple, use devm_kzalloc() instead of kzalloc().
> > []
> >> diff --git a/drivers/rtc/rtc-pl030.c b/drivers/rtc/rtc-pl030.c
> > []
> >> @@ -106,7 +106,7 @@ static int pl030_probe(struct amba_device *dev, const struct amba_id *id)
> >>   	if (ret)
> >>   		goto err_req;
> >>   
> >> -	rtc = kmalloc(sizeof(*rtc), GFP_KERNEL);
> >> +	rtc = devm_kzalloc(&dev->dev, sizeof(*rtc), GFP_KERNEL);
[]
> > You're not deleting a memset and you're
> > converting a kmalloc.
> You are right.
> >
> > Why do you need the zalloc version?
> >
> The key point of this patch is resource-managed memory allocation.

The commit message doesn't match the patch subject
(shows kzalloc)

I was a bit surprised to find there isn't a devm_kmalloc.

This seems fine otherwise.

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