Re: [PATCH] can: j1939: j1939_sk_bind(): fix j1939_ecu leak when re-bind failed
Tetsuo Handa <[email protected]>
| Newsgroups | org.kernel.vger.linux-can,dev.linux.lists.sashiko-reviews |
|---|---|
| Message-ID | <[email protected]> |
Hello, sashiko. On 2026/08/21 1:40, [email protected] wrote: > Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: > > Pre-existing issues: > - [High] Netdevice refcount leak due to a race condition where the unregister notifier misses a socket during bind or re-bind list manipulations. > -- Thanks for the comment. However, I consider this is a false positive and won't cause a permanent hang. If j1939_netdev_stop() is temporarily skipped because a socket is missing from the list during a re-bind window, priv->rx_kref remains non-zero. This prevents __j1939_rx_release() from clearing the netdev mapping (j1939_priv_set(priv->ndev, NULL)). Since the netdev core repeatedly retries NETDEV_UNREGISTER notifications as long as references exist, the next retry window will successfully capture the returned socket on the list and execute j1939_netdev_stop() properly.