Skip to content

Commit

Permalink
hv_netvsc: pass netvsc_device to rndis halt
Browse files Browse the repository at this point in the history
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 <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed Mar 18, 2018
1 parent a3a41d2 commit 0e96460
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/net/hyperv/rndis_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -944,12 +944,11 @@ static bool netvsc_device_idle(const struct netvsc_device *nvdev)
return true;
}

static void rndis_filter_halt_device(struct rndis_device *dev)
static void rndis_filter_halt_device(struct netvsc_device *nvdev,
struct rndis_device *dev)
{
struct rndis_request *request;
struct rndis_halt_request *halt;
struct net_device_context *net_device_ctx = netdev_priv(dev->ndev);
struct netvsc_device *nvdev = rtnl_dereference(net_device_ctx->nvdev);

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

/* Halt and release the rndis device */
rndis_filter_halt_device(rndis_dev);
rndis_filter_halt_device(net_dev, rndis_dev);

net_dev->extension = NULL;

Expand Down

0 comments on commit 0e96460

Please sign in to comment.