diff options
| author | Jesse Gross <jesse@nicira.com> | 2010-12-23 16:28:23 -0800 |
|---|---|---|
| committer | Jesse Gross <jesse@nicira.com> | 2010-12-29 09:54:21 -0800 |
| commit | f827d749920e1bcc275660695144d25c7adbbd4b (patch) | |
| tree | 4683fb65b38beaf5a4281a69b681ec48c35bdafc /datapath/vport-patch.c | |
| parent | e70f33fc8ae27732edd40841402bc38a3ca5d42a (diff) | |
| download | openvswitch-f827d749920e1bcc275660695144d25c7adbbd4b.tar.gz | |
datapath: Add missing rtnl_dereference() calls.
There are a few additional places where RCU protected pointers
are directly dereferenced because they assume RTNL lock. These
were previously not reported due to some other sparse errors in
the Linux headers files. This adds the necessary rtnl_dereference()
calls to make sparse happy and allow lockdep to validate.
Found with sparse.
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'datapath/vport-patch.c')
| -rw-r--r-- | datapath/vport-patch.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/datapath/vport-patch.c b/datapath/vport-patch.c index b03c3aa1c..ef9778f3c 100644 --- a/datapath/vport-patch.c +++ b/datapath/vport-patch.c @@ -156,7 +156,8 @@ static int patch_modify(struct vport *vport, struct odp_port *port) 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; @@ -221,7 +222,8 @@ static int patch_set_mtu(struct vport *vport, int mtu) 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; @@ -236,7 +238,8 @@ static int patch_set_addr(struct vport *vport, const unsigned char *addr) 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; |
