Subject: Re: [PATCH net] rtnetlink: fix leak of SRCU struct in rtnl_link_register

From: Sabrina Dubroca <[email-masked]>
Date: Fri, 20 Mar 2026 08:23:42 +0100

2026-03-19, 17:05:41 -0700, Jakub Kicinski wrote:
> On Wed, 18 Mar 2026 17:15:15 +0100 Sabrina Dubroca wrote:
> >  	list_add_tail_rcu(&ops->list, &link_ops);
> >  unlock:
> > +	if (err)
> > +		cleanup_srcu_struct(&ops->srcu);
> > +
> >  	mutex_unlock(&link_ops_mutex);
> 
> Does the cleanup have to be under the lock?

Right. I'll send a v2.
(OTOH I don't think we'll ever have to worry about contention on this
lock, but we've probably said that about many locks in the past)

-- 
Sabrina