hv_netvsc: Fix error handling in netvsc_attach()
authorHaiyang Zhang <haiyangz@microsoft.com>
Wed, 30 Oct 2019 15:32:13 +0000 (15:32 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Nov 2019 18:21:15 +0000 (19:21 +0100)
commite66f52eb3f292b7f70376c512d8e11d9d58241a0
tree1b168ae40cfb3de6f998e26b42a043ba11877857
parent99d5f18cebbf3f01f269368923e9b9c3ac134700
hv_netvsc: Fix error handling in netvsc_attach()

[ Upstream commit 719b85c336ed35565d0f3982269d6f684087bb00 ]

If rndis_filter_open() fails, we need to remove the rndis device created
in earlier steps, before returning an error code. Otherwise, the retry of
netvsc_attach() from its callers will fail and hang.

Fixes: 7b2ee50c0cd5 ("hv_netvsc: common detach logic")
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/hyperv/netvsc_drv.c