[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <41214f23-ddb1-f60c-5e2a-96ba161cf727@linaro.org>
Date: Fri, 18 Feb 2022 14:17:57 +0100
From: Daniel Lezcano <daniel.lezcano@...aro.org>
To: Ulf Hansson <ulf.hansson@...aro.org>
Cc: rjw@...ysocki.net, heiko@...ech.de, lukasz.luba@....com,
linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
Daniel Lezcano <daniel.lezcano@...nel.org>,
"Rafael J. Wysocki" <rafael@...nel.org>
Subject: Re: [PATCH v1 3/7] powercap/dtpm: Fixup kfree for virtual node
On 17/02/2022 16:45, Ulf Hansson wrote:
[ ... ]
> Does ops->release() also resets the "dtpm" pointer to NULL? If not,
> it's good practice that it should, right?
>
> In that case, we would be calling "kfree(NULL);" the second time,
> which is perfectly fine.
So you suggest to replace:
if (ops->release)
ops->release(dtpm);
else
kfree(dtpm);
By:
if (ops->release) {
ops->release(dtpm);
dtpm = NULL;
}
kfree(dtpm);
?
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
Powered by blists - more mailing lists