diff options
author | stephen hemminger <stephen@networkplumber.org> | 2017-03-22 14:51:05 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-03-22 19:38:57 -0700 |
commit | ce12b81061a0a2647ca90c04d131d90edd5c5063 (patch) | |
tree | 35c8d0f79f99dca016af4c06885a96fad15f548f /drivers/net/hyperv | |
parent | ebc1dcf6008e562a8f88a6b1f4a4705f4d4c4fdd (diff) | |
download | blackbird-obmc-linux-ce12b81061a0a2647ca90c04d131d90edd5c5063.tar.gz blackbird-obmc-linux-ce12b81061a0a2647ca90c04d131d90edd5c5063.zip |
netvsc: fix and cleanup rndis_filter_set_packet_filter
Fix warning from unused set_complete variable. And rearrange code
to eliminate unnecessary goto's.
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/hyperv')
-rw-r--r-- | drivers/net/hyperv/rndis_filter.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c index cd7b83707e04..91b3bcfd9acb 100644 --- a/drivers/net/hyperv/rndis_filter.c +++ b/drivers/net/hyperv/rndis_filter.c @@ -819,16 +819,14 @@ int rndis_filter_set_packet_filter(struct rndis_device *dev, u32 new_filter) { struct rndis_request *request; struct rndis_set_request *set; - struct rndis_set_complete *set_complete; int ret; request = get_rndis_request(dev, RNDIS_MSG_SET, RNDIS_MESSAGE_SIZE(struct rndis_set_request) + sizeof(u32)); - if (!request) { - ret = -ENOMEM; - goto cleanup; - } + if (!request) + return -ENOMEM; + /* Setup the rndis set */ set = &request->request_msg.msg.set_req; @@ -840,15 +838,11 @@ int rndis_filter_set_packet_filter(struct rndis_device *dev, u32 new_filter) &new_filter, sizeof(u32)); ret = rndis_filter_send_request(dev, request); - if (ret != 0) - goto cleanup; + if (ret == 0) + wait_for_completion(&request->wait_event); - wait_for_completion(&request->wait_event); + put_rndis_request(dev, request); - set_complete = &request->response_msg.msg.set_complete; -cleanup: - if (request) - put_rndis_request(dev, request); return ret; } |