# Re: \[RFC PATCH net-next 1/2\] devlink: Hold a reference on parent device

- From: Jakub Kicinski \<kuba@kernel.org\>
- Date: 2023-06-20 17:43:52 
- List: netdev
- Page: https://ratatoskr.run/netdev/2023/06/11264351
- Thread: https://ratatoskr.run/netdev/2023/06/11264182/t.md

```text
On Tue, 20 Jun 2023 10:05:23 +0300 Ido Schimmel wrote:
> On Tue, Jun 20, 2023 at 08:23:26AM +0200, Jiri Pirko wrote:
> > Mon, Jun 19, 2023 at 02:50:14PM CEST, idosch@nvidia.com wrote:  
>  [...]  
> > 
> > Reviewed-by: Jiri Pirko <redacted>  
> 
> Thanks, but I was hoping to get feedback on how to solve the problem
> mentioned in the commit message :p

Do we need to hold the reference on the device until release?
I think you can release it in devlink_free().
The only valid fields for an unregistered devlink instance are:
 - lock
 - refcount
 - index

And obviously unregistered devices can't be reloaded.
```
