Re: [PATCH v3.2] can: j1939: fix j1939_ecu refcount leak
From: Tetsuo Handa
Date: Tue Oct 27 2026 - 10:38:12 EST
On 2026/10/27 12:31, Karl Mehltretter wrote:
> This is based on source review with AI assistance. I have not reproduced
> the unregister hang at runtime.
>
> Could teardown use a lookup that permits NETREG_UNREGISTERING and a dead
> rx_kref, while retaining the nonzero ecu->kref check? The registration
> and receive-lifetime restrictions are needed when acquiring new users,
> but cleanup must still find the ECU whose reference it owns.
>
> The ecu->kref check remains necessary because zero-reference entries stay on
> the list until the RCU callback removes them.
Thank you. Sashiko has the same opinion
( https://sashiko.dev/#/patchset/3958917c-1484-41e8-8d62-99575edbf980%40I-love.SAKURA.ne.jp )
and I followed it in the v4 patch.
Sashiko thinks the v4 patch is OK
( https://sashiko.dev/#/patchset/4b2c8d95-d17e-4f36-a340-abf84693d24a%40I-love.SAKURA.ne.jp ).
It is time to check using multiple models via the review bot.