[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140213190730.GB28112@sirena.org.uk>
Date: Thu, 13 Feb 2014 19:07:30 +0000
From: Mark Brown <broonie@...nel.org>
To: Krzysztof Kozlowski <k.kozlowski@...sung.com>
Cc: Sangbeom Kim <sbkim73@...sung.com>,
Samuel Ortiz <sameo@...ux.intel.com>,
Lee Jones <lee.jones@...aro.org>, linux-kernel@...r.kernel.org,
linux-samsung-soc@...r.kernel.org,
Kyungmin Park <kyungmin.park@...sung.com>,
Marek Szyprowski <m.szyprowski@...sung.com>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>,
Chanwoo Choi <cw00.choi@...sung.com>,
Liam Girdwood <lgirdwood@...il.com>,
Yadwinder Singh Brar <yadi.brar01@...il.com>
Subject: Re: [PATCH v2 07/14] regulator: s2mps11: Copy supported regulators
from initconst
On Thu, Feb 13, 2014 at 10:14:00AM +0100, Krzysztof Kozlowski wrote:
> - for (i = 0; i < S2MPS11_REGULATOR_CNT; i++)
> + s2mps11->rdev = devm_kzalloc(&pdev->dev,
> + sizeof(*s2mps11->rdev)*rdev_num, GFP_KERNEL);
> + if (!s2mps11->rdev)
> + return -ENOMEM;
If we're using managed allocations do we actually need to keep the rdev
table at all? We only normally use it to free.
> + rdata = devm_kzalloc(&pdev->dev, sizeof(*rdata)*rdev_num, GFP_KERNEL);
> + if (!rdata)
> + return -ENOMEM;
> +
> + /* rdata was needed only for of_regulator_match() during probe */
> + if (rdata)
> + devm_kfree(&pdev->dev, rdata);
> +
If this is always going to be freed within the probe path (in the same
function indeed) why is it a managed allocaton at all?
Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)
Powered by blists - more mailing lists