hv_netvsc: use start_remove flag to protect netvsc_link_change()
authorVitaly Kuznetsov <vkuznets@redhat.com>
Fri, 13 May 2016 11:55:21 +0000 (13:55 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 16 May 2016 17:26:00 +0000 (13:26 -0400)
commit1bdcec8a5f05445752a0639edd603ac09ae6c553
tree09c637dad4d6a3a111646b5354c1a1852c3fa581
parentf580aec4bfd7babe51f086e599400027def08ed8
hv_netvsc: use start_remove flag to protect netvsc_link_change()

netvsc_link_change() can race with netvsc_change_mtu() or
netvsc_set_channels() as these functions destroy struct netvsc_device and
rndis filter. Use start_remove flag for syncronization. As
netvsc_change_mtu()/netvsc_set_channels() are called with rtnl lock held
we need to take it before checking start_remove value in
netvsc_link_change().

Reported-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/hyperv/netvsc_drv.c