[PATCH v4 09/14] drm/tidss: oldi: Fix cleanup on a failed init
Aradhya Bhatia
aradhya.bhatia at linux.dev
Mon Nov 2 05:30:42 PST 2026
On 02/11/26 11:46, Tomi Valkeinen wrote:
> Hi,
>
> On 01/11/2026 16:14, Aradhya Bhatia wrote:
>> Hi Tomi,
>>
>> On 29/10/26 10:18, Tomi Valkeinen wrote:
>>> tidss_oldi_init() registers a bridge for each OLDI TX in turn. If a
>>> later
>>> OLDI TX fails, the bridges registered for the earlier ones are not
>>> removed.
>>>
>>> Fix this by calling tidss_oldi_deinit() in the error path.
>>>
>>> Fixes: 7246e0929945 ("drm/tidss: Add OLDI bridge support")
>>> Signed-off-by: Tomi Valkeinen <tomi.valkeinen at ideasonboard.com>
>>> ---
>>> drivers/gpu/drm/tidss/tidss_oldi.c | 1 +
>>> 1 file changed, 1 insertion(+)
>>>
>>> diff --git a/drivers/gpu/drm/tidss/tidss_oldi.c b/drivers/gpu/drm/
>>> tidss/tidss_oldi.c
>>> index 506507e83112..7344d86e1f13 100644
>>> --- a/drivers/gpu/drm/tidss/tidss_oldi.c
>>> +++ b/drivers/gpu/drm/tidss/tidss_oldi.c
>>> @@ -638,5 +638,6 @@ int tidss_oldi_init(struct tidss_device *tidss)
>>> err_put_node:
>>> of_node_put(child);
>>> of_node_put(oldi_parent);
>>> + tidss_oldi_deinit(tidss);
>>> return ret;
>>> }
>>>
>>
>> Since tidss_probe() (in tidss_drv.c) calls tidss_oldi_init(), it also
>> calls tidss_oldi_deinit() in its error exit path.
> Yes, but not if tidss_oldi_init() itself fails.
>
> If we have two OLDI TXes, and the loop in tidss_oldi_init() inits the
> first one, then the second one's init fails, the code jumps to
> err_put_node. If we don't call tidss_oldi_deinit() there, the first OLDI
> TX will not be "deinited".
Thanks, I see what you mean.
Reviewed-by: Aradhya Bhatia <aradhya.bhatia at linux.dev>
--
Regards
Aradhya
More information about the linux-arm-kernel
mailing list