diff options
author | Haiyang Zhang <haiyangz@microsoft.com> | 2012-10-02 05:30:23 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-10-02 14:39:31 -0400 |
commit | 63f6921d300c6fbdca3d0e73dcc24b4e5e4dced2 (patch) | |
tree | 5cd2560e12959f51574e0235bc1d9bdb81b30b98 /drivers/net/hyperv/rndis_filter.c | |
parent | hyperv: Remove extra allocated space for recv_pkt_list elements (diff) | |
download | linux-dev-63f6921d300c6fbdca3d0e73dcc24b4e5e4dced2.tar.xz linux-dev-63f6921d300c6fbdca3d0e73dcc24b4e5e4dced2.zip |
hyperv: Report actual status in receive completion packet
The existing code always reports NVSP_STAT_SUCCESS. This patch adds the
mechanism to report failure when it happens.
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r-- | drivers/net/hyperv/rndis_filter.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c index f25f41e1fdb7..e7e12cfbbf37 100644 --- a/drivers/net/hyperv/rndis_filter.c +++ b/drivers/net/hyperv/rndis_filter.c @@ -411,9 +411,12 @@ int rndis_filter_receive(struct hv_device *dev, struct rndis_device *rndis_dev; struct rndis_message *rndis_msg; struct net_device *ndev; + int ret = 0; - if (!net_dev) - return -EINVAL; + if (!net_dev) { + ret = -EINVAL; + goto exit; + } ndev = net_dev->ndev; @@ -421,14 +424,16 @@ int rndis_filter_receive(struct hv_device *dev, if (!net_dev->extension) { netdev_err(ndev, "got rndis message but no rndis device - " "dropping this message!\n"); - return -ENODEV; + ret = -ENODEV; + goto exit; } rndis_dev = (struct rndis_device *)net_dev->extension; if (rndis_dev->state == RNDIS_DEV_UNINITIALIZED) { netdev_err(ndev, "got rndis message but rndis device " "uninitialized...dropping this message!\n"); - return -ENODEV; + ret = -ENODEV; + goto exit; } rndis_msg = pkt->data; @@ -460,7 +465,11 @@ int rndis_filter_receive(struct hv_device *dev, break; } - return 0; +exit: + if (ret != 0) + pkt->status = NVSP_STAT_FAIL; + + return ret; } static int rndis_filter_query_device(struct rndis_device *dev, u32 oid, |