From: baihaowen <baihaowen@meizu.com>
To: Vinod Koul <vkoul@kernel.org>
Cc: Shawn Guo <shawnguo@kernel.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Fabio Estevam <festevam@gmail.com>,
NXP Linux Team <linux-imx@nxp.com>, <dmaengine@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] dmaengine: imx-sdma: Remove useless null check before call of_node_put()
Date: Fri, 22 Apr 2022 14:17:18 +0800 [thread overview]
Message-ID: <dc948948-5d69-e9b1-417b-7d6b8824782c@meizu.com> (raw)
In-Reply-To: <YmJGw84by8eczx/u@matsya>
在 4/22/22 2:10 PM, Vinod Koul 写道:
> On 21-04-22, 10:49, Haowen Bai wrote:
>> No need to add null check before call of_node_put(), since the
>> implementation of of_node_put() has done it.
>>
>> Signed-off-by: Haowen Bai <baihaowen@meizu.com>
>> ---
>> drivers/dma/imx-sdma.c | 3 +--
>> 1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
>> index 6196a7b3956b..b8a1299b93f0 100644
>> --- a/drivers/dma/imx-sdma.c
>> +++ b/drivers/dma/imx-sdma.c
>> @@ -1933,8 +1933,7 @@ static int sdma_event_remap(struct sdma_engine *sdma)
>> }
>>
>> out:
>> - if (gpr_np)
>> - of_node_put(gpr_np);
>> + of_node_put(gpr_np);
> this is incorrect as it is called on error case
>
>
Even through it is called on error case, gpr_np=null, but of_node_put
did a null check.
void of_node_put(struct device_node *node)
{ if (node) kobject_put(&node->kobj); }
--
Haowen Bai
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2022-04-22 6:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-21 2:49 [PATCH] dmaengine: imx-sdma: Remove useless null check before call of_node_put() Haowen Bai
2022-04-22 6:10 ` Vinod Koul
2022-04-22 6:17 ` baihaowen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=dc948948-5d69-e9b1-417b-7d6b8824782c@meizu.com \
--to=baihaowen@meizu.com \
--cc=dmaengine@vger.kernel.org \
--cc=festevam@gmail.com \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
--cc=vkoul@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox