File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ void netvsc_switch_datapath(struct net_device *ndev, bool vf)
41
41
{
42
42
struct net_device_context * net_device_ctx = netdev_priv (ndev );
43
43
struct hv_device * dev = net_device_ctx -> device_ctx ;
44
- struct netvsc_device * nv_dev = net_device_ctx -> nvdev ;
44
+ struct netvsc_device * nv_dev = rtnl_dereference ( net_device_ctx -> nvdev ) ;
45
45
struct nvsp_message * init_pkt = & nv_dev -> channel_init_pkt ;
46
46
47
47
memset (init_pkt , 0 , sizeof (struct nvsp_message ));
@@ -549,7 +549,8 @@ void netvsc_device_remove(struct hv_device *device)
549
549
{
550
550
struct net_device * ndev = hv_get_drvdata (device );
551
551
struct net_device_context * net_device_ctx = netdev_priv (ndev );
552
- struct netvsc_device * net_device = net_device_ctx -> nvdev ;
552
+ struct netvsc_device * net_device
553
+ = rtnl_dereference (net_device_ctx -> nvdev );
553
554
int i ;
554
555
555
556
netvsc_disconnect_vsp (device );
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ static void netvsc_set_multicast_list(struct net_device *net)
69
69
static int netvsc_open (struct net_device * net )
70
70
{
71
71
struct net_device_context * ndev_ctx = netdev_priv (net );
72
- struct netvsc_device * nvdev = ndev_ctx -> nvdev ;
72
+ struct netvsc_device * nvdev = rtnl_dereference ( ndev_ctx -> nvdev ) ;
73
73
struct rndis_device * rdev ;
74
74
int ret = 0 ;
75
75
@@ -1364,7 +1364,7 @@ static struct net_device *get_netvsc_byref(struct net_device *vf_netdev)
1364
1364
continue ; /* not a netvsc device */
1365
1365
1366
1366
net_device_ctx = netdev_priv (dev );
1367
- if (net_device_ctx -> nvdev == NULL )
1367
+ if (! rtnl_dereference ( net_device_ctx -> nvdev ) )
1368
1368
continue ; /* device is removed */
1369
1369
1370
1370
if (rtnl_dereference (net_device_ctx -> vf_netdev ) == vf_netdev )
@@ -1589,7 +1589,8 @@ static int netvsc_remove(struct hv_device *dev)
1589
1589
* removed. Also blocks mtu and channel changes.
1590
1590
*/
1591
1591
rtnl_lock ();
1592
- rndis_filter_device_remove (dev , ndev_ctx -> nvdev );
1592
+ rndis_filter_device_remove (dev ,
1593
+ rtnl_dereference (ndev_ctx -> nvdev ));
1593
1594
rtnl_unlock ();
1594
1595
1595
1596
unregister_netdev (net );
You can’t perform that action at this time.
0 commit comments