Subject: Re: [PATCH net-next v4 1/2] macsec: add support for IFLA_MACSEC_OFFLOAD in macsec_changelink

From: Jakub Kicinski <[email-masked]>
Date: Thu, 8 Dec 2022 18:32:44 -0800

On Thu, 8 Dec 2022 13:55:16 +0200 [email-masked] wrote:
> +	dev = get_dev_from_nl(genl_info_net(info), attrs);

What prevents this dev from disappearing before...

> +	if (IS_ERR(dev))
> +		return PTR_ERR(dev);
> +	if (!tb_offload[MACSEC_OFFLOAD_ATTR_TYPE])
> +		return -EINVAL;
> +
> +	offload = nla_get_u8(tb_offload[MACSEC_OFFLOAD_ATTR_TYPE]);
> +
> +	rtnl_lock();

... we finally take the lock?

I think you're just moving this code, but still.

> +	ret = macsec_update_offload(dev, offload);
>  
>  	rtnl_unlock();