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, 5 Feb 2021 12:12:17 +0000
From:   Matthew Wilcox <willy@...radead.org>
To:     Minchan Kim <minchan@...nel.org>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        gregkh@...uxfoundation.org, surenb@...gle.com, joaodias@...gle.com,
        LKML <linux-kernel@...r.kernel.org>,
        linux-mm <linux-mm@...ck.org>
Subject: Re: [PATCH] mm: cma: support sysfs

On Thu, Feb 04, 2021 at 09:22:18PM -0800, Minchan Kim wrote:
> > > +	for (i = 0; i < cma_area_count; i++) {
> > > +		cma = &cma_areas[i];
> > > +		stat = kzalloc(sizeof(*stat), GFP_KERNEL);
> > > +		if (!stat)
> > > +			goto out;
> > 
> > How many cma areas are there going to be?  do we really want to allocate
> > their stat individually?
> 
> I am not sure what could be in the end but at least, I have
> 5+ candidates (but could be shrink or extend) and yes,
> want to keep track them individually.

I meant, wouldn't it be better to:

	cma_stats = kzalloc(array_size(sizeof(*stat), cma_area_count),
				GFP_KERNEL);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ