Subject: Re: [PATCH net-next v2 6/6] net: marvell: prestera: Implement initial inetaddr notifiers

From: Yevhen Orlov <[email-masked]>
Date: Thu, 6 Jan 2022 06:31:06 +0200

On Thu, Dec 30, 2021 at 04:39:23PM +0200, Ido Schimmel wrote:
> > +			return -EEXIST;
> > +		}
> > +		re = prestera_rif_entry_create(port->sw, &re_key,
> > +					       prestera_fix_tb_id(kern_tb_id),
> > +					       port_dev->dev_addr);
> > +		if (!re) {
> > +			NL_SET_ERR_MSG_MOD(extack, "Can't create rif_entry");
> > +			return -EINVAL;
> > +		}
> > +		dev_hold(port_dev);
>
> What is the purpose of this dev_hold()?
>

To make sure the port_dev is not freed before rif destroyed.