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: <3286eb91-f5b8-a4b4-2031-5be50cbb9206@linaro.org>
Date:   Thu, 28 Nov 2019 15:52:02 +0200
From:   Georgi Djakov <georgi.djakov@...aro.org>
To:     Dmitry Osipenko <digetx@...il.com>, linux-pm@...r.kernel.org
Cc:     bjorn.andersson@...aro.org, agross@...nel.org,
        evgreen@...omium.org, daidavid1@...eaurora.org,
        masneyb@...tation.org, sibis@...eaurora.org,
        linux-kernel@...r.kernel.org, linux-arm-msm@...r.kernel.org
Subject: Re: [PATCH 5/5] interconnect: qcom: Use the new common helper for
 node removal

On 28.11.19 г. 15:43 ч., Dmitry Osipenko wrote:
> 28.11.2019 16:34, Georgi Djakov пишет:
>> There is a new helper function for removing all nodes. Let's use it instead
>> of duplicating the code.
>>
>> In addition to the above, instead of duplicating the code, simplify the
>> probe function error path by calling driver removal function directly.
>>
>> Signed-off-by: Georgi Djakov <georgi.djakov@...aro.org>
>> ---
>>   drivers/interconnect/qcom/msm8974.c | 40 ++++++++++-------------------
>>   drivers/interconnect/qcom/qcs404.c  | 31 ++++++++--------------
>>   drivers/interconnect/qcom/sdm845.c  | 29 +++++++--------------
>>   3 files changed, 33 insertions(+), 67 deletions(-)
>>
[..]>> +static int qnoc_remove(struct platform_device *pdev)
>> +{
>> +	struct qcom_icc_provider *qp = platform_get_drvdata(pdev);
>> +
>> +	icc_nodes_remove(&qp->provider);
>> +	return icc_provider_del(&qp->provider);
>> +}
>> +
>>   static int qnoc_probe(struct platform_device *pdev)
>>   {
>>   	const struct qcom_icc_desc *desc;
>> @@ -855,29 +863,10 @@ static int qnoc_probe(struct platform_device *pdev)
>>   
>>   	return ret;
>>   err:
>> -	list_for_each_entry(node, &provider->nodes, node_list) {
>> -		icc_node_del(node);
>> -		icc_node_destroy(node->id);
>> -	}
>> -
>> -	icc_provider_del(provider);
>> +	qnoc_remove(pdev);
> 
> This is wrong because platform_set_drvdata() is invoked at the end of
> qnoc_probe(), thus platform_get_drvdata() of qnoc_remove() returns NULL
> here.

True! Will fix it! Thank you!

BR,
Georgi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ