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:   Mon, 11 Jun 2018 10:18:22 +0100
From:   Suzuki K Poulose <Suzuki.Poulose@....com>
To:     Mathieu Poirier <mathieu.poirier@...aro.org>
Cc:     linux-arm-kernel@...ts.infradead.org, robh@...nel.org,
        frowand.list@...il.com, mark.rutland@....com, sudeep.holla@....com,
        arm@...nel.org, linux-kernel@...r.kernel.org, matt.sealey@....com,
        john.horley@....com, charles.garcia-tobin@....com,
        coresight@...ts.linaro.org, devicetree@...r.kernel.org,
        mike.leach@...aro.org
Subject: Re: [PATCH 02/20] coresight: of: Fix refcounting for graph nodes

On 08/06/18 20:55, Mathieu Poirier wrote:
> On Tue, Jun 05, 2018 at 10:43:13PM +0100, Suzuki K Poulose wrote:
>> The coresight driver doesn't drop the references on the
>> remote endpoint/port nodes. Add the missing of_node_put()
>> calls. To make it easier to handle different corner cases
>> cleanly, move the parsing of an endpoint to separate
>> function.
> 
> Please split this as those are two different things.

Mathieu,

I can do that, its only that if someone were to backport
the fix for an older kernel, they would need to pick up these
two patches, which is still fine.

> 
>>
>> Reported-by: Mathieu Poirier <mathieu.poirier@...aro.org>
>> Signed-off-by: Suzuki K Poulose <suzuki.poulose@....com>
>> ---
>>   drivers/hwtracing/coresight/of_coresight.c | 139 +++++++++++++++++------------
>>   1 file changed, 84 insertions(+), 55 deletions(-)
>>
>> diff --git a/drivers/hwtracing/coresight/of_coresight.c b/drivers/hwtracing/coresight/of_coresight.c
>> index a33a92e..8a23c63 100644
>> --- a/drivers/hwtracing/coresight/of_coresight.c
>> +++ b/drivers/hwtracing/coresight/of_coresight.c

>> +static int of_coresight_parse_endpoint(struct device_node *ep,
>> +				       struct coresight_platform_data *pdata,
>> +				       int *i)
>> +{
>> +	int ret = 0;
>> +	struct of_endpoint endpoint, rendpoint;
>> +	struct device_node *rparent = NULL;
>> +	struct device_node *rport = NULL;
>> +	struct device *rdev = NULL;
>> +
>> +	do {

...

>> +	} while (0);
> 
> That's a clever way of coding a classic 'goto' block.
> 
>> +
>> +	if (rparent)
>> +		of_node_put(rparent);
>> +	if (rport)
>> +		of_node_put(rport);
> 
> Perfect - thank you for that.
> 

>>   	pdata->name = dev_name(dev);
>> +	pdata->cpu = of_coresight_get_cpu(node);
>>   
>>   	/* Get the number of input and output port for this component */
>>   	of_coresight_get_ports(node, &pdata->nr_inport, &pdata->nr_outport);
>>   
>> -	if (pdata->nr_outport) {
>> -		ret = of_coresight_alloc_memory(dev, pdata);
>> +	/* If there are not output connections, we are done */
> 
> /not/no

Thanks for spotting.

Suzuki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ