Commit 5243e7bd authored by Haiyang Zhang's avatar Haiyang Zhang Committed by David S. Miller

hyperv: Add error handling to rndis_filter_device_add()

Reported-by: default avatarJason Wang <jasowang@redhat.com>
Signed-off-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fa85a6c2
...@@ -804,18 +804,15 @@ int rndis_filter_device_add(struct hv_device *dev, ...@@ -804,18 +804,15 @@ int rndis_filter_device_add(struct hv_device *dev,
/* Send the rndis initialization message */ /* Send the rndis initialization message */
ret = rndis_filter_init_device(rndis_device); ret = rndis_filter_init_device(rndis_device);
if (ret != 0) { if (ret != 0) {
/* rndis_filter_device_remove(dev);
* TODO: If rndis init failed, we will need to shut down the return ret;
* channel
*/
} }
/* Get the mac address */ /* Get the mac address */
ret = rndis_filter_query_device_mac(rndis_device); ret = rndis_filter_query_device_mac(rndis_device);
if (ret != 0) { if (ret != 0) {
/* rndis_filter_device_remove(dev);
* TODO: shutdown rndis device and the channel return ret;
*/
} }
memcpy(device_info->mac_adr, rndis_device->hw_mac_adr, ETH_ALEN); memcpy(device_info->mac_adr, rndis_device->hw_mac_adr, ETH_ALEN);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment