[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9f93fe1f-c7d7-7d96-44ab-2bca0aae407e@huawei.com>
Date: Tue, 27 Aug 2024 09:42:30 +0800
From: Jinjie Ruan <ruanjinjie@...wei.com>
To: Marion & Christophe JAILLET <christophe.jaillet@...adoo.fr>,
<hjc@...k-chips.com>, <heiko@...ech.de>, <andy.yan@...k-chips.com>,
<maarten.lankhorst@...ux.intel.com>, <mripard@...nel.org>,
<tzimmermann@...e.de>, <airlied@...il.com>, <daniel@...ll.ch>,
<dri-devel@...ts.freedesktop.org>, <linux-arm-kernel@...ts.infradead.org>,
<linux-rockchip@...ts.infradead.org>, <linux-kernel@...r.kernel.org>,
<krzk@...nel.org>, <jic23@...nel.org>
Subject: Re: [PATCH -next 2/5] drm/mediatek: Fix missing of_node_put() for
mtk_drm_get_all_drm_priv()
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
>
Powered by blists - more mailing lists