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: <3cee6641-a376-6caf-6b32-297fb2cb32df@arm.com>
Date:   Thu, 25 Apr 2019 18:12:34 +0100
From:   Suzuki K Poulose <suzuki.poulose@....com>
To:     mathieu.poirier@...aro.org
Cc:     linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        coresight@...ts.linaro.org, mike.leach@...aro.org,
        rjw@...ysocki.net, robert.walker@....com
Subject: Re: [PATCH v2 25/36] coresight: Rearrange platform data probing



On 22/04/2019 18:16, Mathieu Poirier wrote:
> On Mon, Apr 15, 2019 at 05:04:08PM +0100, Suzuki K Poulose wrote:
>> We are about to introduce methods to clean up the platform data
>> as we switch to tracking the device reference from "name" to "fwnode
>> handles" for device connections. This requires us to drop the fwnode
>> handle references when the data is no longer required - i.e, when
>> the device probe fails or the device gets unregistered.
>>
>> In order to consolidate the invocation of the cleanup, we delay the
>> platform probing to the very last minute, possibly before invoking
>> the coresight_register. Then, we leave the coresight core code to
>> do the clean up. i.e, if the coresight_register fails, it takes
>> care of freeing the data. Otherwise, coresight_unregister will
>> do the necessary operations.
>>
>> Cc: Mathieu Poirier <mathieu.poirier@...aro.org>
>> Signed-off-by: Suzuki K Poulose <suzuki.poulose@....com>

...

>> diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c
>> index 7ff0989..7c53fb2 100644
>> --- a/drivers/hwtracing/coresight/coresight-etm4x.c
>> +++ b/drivers/hwtracing/coresight/coresight-etm4x.c
>> @@ -981,11 +981,6 @@ static int etm4_probe(struct amba_device *adev, const struct amba_id *id)
>>   	if (!drvdata)
>>   		return -ENOMEM;
>>   
>> -	pdata = coresight_get_platform_data(dev);
>> -	if (IS_ERR(pdata))
>> -		return PTR_ERR(pdata);
>> -	adev->dev.platform_data = pdata;
>> -
>>   	dev_set_drvdata(dev, drvdata);
>>   
>>   	/* Validity for the resource is already checked by the AMBA core */
>> @@ -1028,6 +1023,11 @@ static int etm4_probe(struct amba_device *adev, const struct amba_id *id)
>>   	etm4_init_trace_id(drvdata);
>>   	etm4_set_default(&drvdata->config);
>>   
>> +	pdata = coresight_get_platform_data(dev);
>> +	if (IS_ERR(pdata))
>> +		return PTR_ERR(pdata);
> 
> Here you need to "goto err_arch_supported" instead of returning.

Thanks for catching that ! Fixed.

Suzuki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ