Skip to content

Commit 0e96460

Browse files
shemmingerdavem330
authored andcommitted
hv_netvsc: pass netvsc_device to rndis halt
The caller has a valid pointer, pass it to rndis_filter_halt_device and avoid any possible RCU races here. Signed-off-by: Stephen Hemminger <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent a3a41d2 commit 0e96460

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

drivers/net/hyperv/rndis_filter.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -944,12 +944,11 @@ static bool netvsc_device_idle(const struct netvsc_device *nvdev)
944944
return true;
945945
}
946946

947-
static void rndis_filter_halt_device(struct rndis_device *dev)
947+
static void rndis_filter_halt_device(struct netvsc_device *nvdev,
948+
struct rndis_device *dev)
948949
{
949950
struct rndis_request *request;
950951
struct rndis_halt_request *halt;
951-
struct net_device_context *net_device_ctx = netdev_priv(dev->ndev);
952-
struct netvsc_device *nvdev = rtnl_dereference(net_device_ctx->nvdev);
953952

954953
/* Attempt to do a rndis device halt */
955954
request = get_rndis_request(dev, RNDIS_MSG_HALT,
@@ -1348,7 +1347,7 @@ void rndis_filter_device_remove(struct hv_device *dev,
13481347
cancel_work_sync(&net_dev->subchan_work);
13491348

13501349
/* Halt and release the rndis device */
1351-
rndis_filter_halt_device(rndis_dev);
1350+
rndis_filter_halt_device(net_dev, rndis_dev);
13521351

13531352
net_dev->extension = NULL;
13541353

0 commit comments

Comments
 (0)