struct tnl_mutable_config *mutable;
int err;
- mutable = kmemdup(tnl_vport->mutable, sizeof(struct tnl_mutable_config), GFP_KERNEL);
+ mutable = kmemdup(rtnl_dereference(tnl_vport->mutable),
+ sizeof(struct tnl_mutable_config), GFP_KERNEL);
if (!mutable) {
err = -ENOMEM;
goto error;
int tnl_destroy(struct vport *vport)
{
struct tnl_vport *tnl_vport = tnl_vport_priv(vport);
- const struct tnl_mutable_config *old_mutable;
+ const struct tnl_mutable_config *mutable, *old_mutable;
+
+ mutable = rtnl_dereference(tnl_vport->mutable);
- if (vport == tnl_find_port(tnl_vport->mutable->port_config.saddr,
- tnl_vport->mutable->port_config.daddr,
- tnl_vport->mutable->port_config.in_key,
- tnl_vport->mutable->tunnel_type,
- &old_mutable))
+ if (vport == tnl_find_port(mutable->port_config.saddr,
+ mutable->port_config.daddr, mutable->port_config.in_key,
+ mutable->tunnel_type, &old_mutable))
del_port(vport);
call_rcu(&tnl_vport->rcu, free_port_rcu);
struct tnl_vport *tnl_vport = tnl_vport_priv(vport);
struct tnl_mutable_config *mutable;
- mutable = kmemdup(tnl_vport->mutable, sizeof(struct tnl_mutable_config), GFP_KERNEL);
+ mutable = kmemdup(rtnl_dereference(tnl_vport->mutable),
+ sizeof(struct tnl_mutable_config), GFP_KERNEL);
if (!mutable)
return -ENOMEM;
struct tnl_vport *tnl_vport = tnl_vport_priv(vport);
struct tnl_mutable_config *mutable;
- mutable = kmemdup(tnl_vport->mutable, sizeof(struct tnl_mutable_config), GFP_KERNEL);
+ mutable = kmemdup(rtnl_dereference(tnl_vport->mutable),
+ sizeof(struct tnl_mutable_config), GFP_KERNEL);
if (!mutable)
return -ENOMEM;
struct device_config *devconf;
int err;
- devconf = kmemdup(patch_vport->devconf, sizeof(struct device_config), GFP_KERNEL);
+ devconf = kmemdup(rtnl_dereference(patch_vport->devconf),
+ sizeof(struct device_config), GFP_KERNEL);
if (!devconf) {
err = -ENOMEM;
goto error;
struct patch_vport *patch_vport = patch_vport_priv(vport);
struct device_config *devconf;
- devconf = kmemdup(patch_vport->devconf, sizeof(struct device_config), GFP_KERNEL);
+ devconf = kmemdup(rtnl_dereference(patch_vport->devconf),
+ sizeof(struct device_config), GFP_KERNEL);
if (!devconf)
return -ENOMEM;
struct patch_vport *patch_vport = patch_vport_priv(vport);
struct device_config *devconf;
- devconf = kmemdup(patch_vport->devconf, sizeof(struct device_config), GFP_KERNEL);
+ devconf = kmemdup(rtnl_dereference(patch_vport->devconf),
+ sizeof(struct device_config), GFP_KERNEL);
if (!devconf)
return -ENOMEM;