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>] [day] [month] [year] [list]
Date:	Mon, 07 Jul 2014 12:36:40 +0200
From:	Marek Szyprowski <m.szyprowski@...sung.com>
To:	Joonsoo Kim <iamjoonsoo.kim@....com>, linux-kernel@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org,
	linaro-mm-sig@...ts.linaro.org, devicetree@...r.kernel.org,
	linux-doc@...r.kernel.org
Cc:	'Benjamin Herrenschmidt' <benh@...nel.crashing.org>,
	'Arnd Bergmann' <arnd@...db.de>,
	'Michal Nazarewicz' <mina86@...a86.com>,
	'Grant Likely' <grant.likely@...aro.org>,
	'Tomasz Figa' <t.figa@...sung.com>,
	'Sascha Hauer' <s.hauer@...gutronix.de>,
	'Laura Abbott' <lauraa@...eaurora.org>,
	'Rob Herring' <robh+dt@...nel.org>,
	'Olof Johansson' <olof@...om.net>,
	'Pawel Moll' <pawel.moll@....com>,
	'Mark Rutland' <mark.rutland@....com>,
	'Stephen Warren' <swarren@...dotorg.org>,
	'Ian Campbell' <ian.campbell@...rix.com>,
	'Tomasz Figa' <tomasz.figa@...il.com>,
	'Kumar Gala' <galak@...eaurora.org>,
	'Nishanth Peethambaran' <nishanth.p@...il.com>,
	'Marc' <marc.ceeeee@...il.com>,
	'Josh Cartwright' <joshc@...eaurora.org>,
	'Catalin Marinas' <catalin.marinas@....com>,
	'Will Deacon' <will.deacon@....com>,
	'Paul Mackerras' <paulus@...ba.org>,
	'Jon Medhurst' <tixy@...aro.org>,
	"'Aneesh Kumar K.V.'" <aneesh.kumar@...ux.vnet.ibm.com>,
	'Andrew Morton' <akpm@...ux-foundation.org>
Subject: Re: [PATCH 4/4] drivers: dma-contiguous: add initialization from
 device tree

Hello,

On 2014-07-04 07:52, Joonsoo Kim wrote:
>> -----Original Message-----
>> From: Marek Szyprowski [mailto:m.szyprowski@...sung.com]
>> Sent: Wednesday, July 02, 2014 7:49 PM
>>
>> Subject: [PATCH 4/4] drivers: dma-contiguous: add initialization from
>> device tree
>>
>> Add a code to create CMA region from reserved memory and add support for
>> handling 'shared-dma-pool' reserved-memory device tree nodes.
>>
>> Signed-off-by: Marek Szyprowski <m.szyprowski@...sung.com>
>> ---
>>   drivers/base/dma-contiguous.c | 67
>> +++++++++++++++++++++++++++++++++++++++++
>>   include/linux/cma.h           |  3 ++
>>   mm/cma.c                      | 69
> ++++++++++++++++++++++++++++++++-----------
>>   3 files changed, 122 insertions(+), 17 deletions(-)
>>

...

>> +/**
>>    * cma_declare_contiguous() - reserve custom contiguous area
>>    * @base: Base address of the reserved area optional, use 0 for any
>>    * @size: Size of the reserved area (in bytes),
>> @@ -162,18 +210,12 @@ int __init cma_declare_contiguous(phys_addr_t base,
>>   			phys_addr_t alignment, unsigned int order_per_bit,
>>   			bool fixed, struct cma **res_cma)
>>   {
>> -	struct cma *cma;
>> -	int ret = 0;
>> +	int ret;
>>
>>   	pr_debug("%s(size %lx, base %08lx, limit %08lx alignment %08lx)\n",
>>   		__func__, (unsigned long)size, (unsigned long)base,
>>   		(unsigned long)limit, (unsigned long)alignment);
>>
>> -	if (cma_area_count == ARRAY_SIZE(cma_areas)) {
>> -		pr_err("Not enough slots for CMA reserved regions!\n");
>> -		return -ENOSPC;
>> -	}
>> -
> Hello, Marek.
>
> After this change, if we have not enough cma_areas, memory will leak.
> I think that we need separate function to check constraint and this
> function should be called before reserving memory in
> cma_declare_contiguous().

Well, I will leave this check to avoid memory leak then.

> BTW, this mail doesn't appear in LKML. What happens? :)

I have no idea, I will send second version then.

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland

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