From: Jinjie Ruan <ruanjinjie@huawei.com>
To: Marion & Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
<hjc@rock-chips.com>, <heiko@sntech.de>,
<andy.yan@rock-chips.com>, <maarten.lankhorst@linux.intel.com>,
<mripard@kernel.org>, <tzimmermann@suse.de>, <airlied@gmail.com>,
<daniel@ffwll.ch>, <dri-devel@lists.freedesktop.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-rockchip@lists.infradead.org>,
<linux-kernel@vger.kernel.org>, <krzk@kernel.org>,
<jic23@kernel.org>
Subject: Re: [PATCH -next 2/5] drm/mediatek: Fix missing of_node_put() for mtk_drm_get_all_drm_priv()
Date: Tue, 27 Aug 2024 09:42:30 +0800 [thread overview]
Message-ID: <9f93fe1f-c7d7-7d96-44ab-2bca0aae407e@huawei.com> (raw)
In-Reply-To: <6d4ec950-878f-499c-a808-dd5b31c2ddb6@wanadoo.fr>
On 2024/8/25 13:16, Marion & Christophe JAILLET wrote:
>
>
> Le 23/08/2024 à 12:46, Christophe JAILLET a écrit :
>>> @@ -933,10 +931,8 @@ static int mtk_drm_probe(struct platform_device
>>> *pdev)
>>> }
>>> ret = mtk_ddp_comp_init(node, &private->ddp_comp[comp_id],
>>> comp_id);
>>> - if (ret) {
>>> - of_node_put(node);
>>> + if (ret)
>>> goto err_node;
>>
>> Hi,
>>
>> I've seen on another thread that is was not sure that scoped versions
>> and gotos played well together.
>>
>> It was asked to check more in details and confirm that it was safe
>> before applying the patch.
>>
>> I've not followed the discussion, so I just point it out, in case it
>> helps.
>>
>> I'll try to give it a look in the coming days.
>>
>>
>> CJ
>>
>
> Hi,
> looking at the generated asm file (gcc 14.2.1), everything looks fine.
Yes, as I pointed out in another thread, the test show that goto with
this scoped function is good.
>
> # drivers/gpu/drm/mediatek/mtk_drm_drv.c:933: ret =
> mtk_ddp_comp_init(node, &private->ddp_comp[comp_id], comp_id);
> salq $5, %rax #, _36
> movl %r14d, %edx # comp_id,
> movq %rbx, %rdi # node,
> leaq 552(%rbp,%rax), %rsi #, _28
> call mtk_ddp_comp_init #
> movl %eax, %r12d # tmp205, <retval>
> # drivers/gpu/drm/mediatek/mtk_drm_drv.c:934: if (ret)
> testl %eax, %eax # <retval>
> jne .L212 #,
>
> ...
>
> .L212:
> # ./include/linux/of.h:138: DEFINE_FREE(device_node, struct device_node
> *, if (_T) of_node_put(_T))
> movq %rbx, %rdi # node,
> call of_node_put #
> jmp .L171 #
>
> CJ
>
next prev parent reply other threads:[~2024-08-27 1:42 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-23 9:20 [PATCH -next 0/5] drm: Use for_each_child_of_node_scoped() Jinjie Ruan
2024-08-23 9:20 ` [PATCH -next 1/5] drm/rockchip: " Jinjie Ruan
2024-08-23 9:45 ` Heiko Stübner
2024-08-23 11:32 ` Jonathan Cameron
2024-08-26 9:04 ` Jinjie Ruan
2024-08-27 1:40 ` Jinjie Ruan
2024-08-27 9:49 ` Jonathan Cameron
2024-08-23 9:20 ` [PATCH -next 2/5] drm/mediatek: Fix missing of_node_put() for mtk_drm_get_all_drm_priv() Jinjie Ruan
2024-08-23 10:46 ` Christophe JAILLET
2024-08-25 5:16 ` Marion & Christophe JAILLET
2024-08-27 1:42 ` Jinjie Ruan [this message]
2024-08-23 9:20 ` [PATCH -next 3/5] drm: of: Use for_each_child_of_node_scoped() Jinjie Ruan
2024-08-23 9:20 ` [PATCH -next 4/5] drm/nouveau: " Jinjie Ruan
2024-08-23 9:20 ` [PATCH -next 5/5] gpu: host1x: Use for_each_available_child_of_node_scoped() Jinjie Ruan
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=9f93fe1f-c7d7-7d96-44ab-2bca0aae407e@huawei.com \
--to=ruanjinjie@huawei.com \
--cc=airlied@gmail.com \
--cc=andy.yan@rock-chips.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=heiko@sntech.de \
--cc=hjc@rock-chips.com \
--cc=jic23@kernel.org \
--cc=krzk@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=tzimmermann@suse.de \
/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
all inboxes | Powered by JetHome®