]> git.baikalelectronics.ru Git - kernel.git/commit
hv_netvsc: protect module refcount by checking net_device_ctx->vf_netdev
authorVitaly Kuznetsov <vkuznets@redhat.com>
Mon, 15 Aug 2016 15:48:42 +0000 (17:48 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 15 Aug 2016 20:48:07 +0000 (13:48 -0700)
commit0d52a7895f1f6960e6efa352710e412413df749d
tree3ac000985b098e8b6ad0773d495570a00c6393a8
parent71fafbbee34d34f0abe61e956d7da14d06a5fe7c
hv_netvsc: protect module refcount by checking net_device_ctx->vf_netdev

We're not guaranteed to see NETDEV_REGISTER/NETDEV_UNREGISTER notifications
only once per VF but we increase/decrease module refcount unconditionally.
Check vf_netdev to make sure we don't take/release it twice. We presume
that only one VF per netvsc device may exist.

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