Skip to content

Commit

Permalink
hyperv: Add error handling to rndis_filter_device_add()
Browse files Browse the repository at this point in the history
Reported-by: Jason Wang <jasowang@redhat.com>
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>
  • Loading branch information
Haiyang Zhang authored and David S. Miller committed Jul 25, 2012
1 parent fa85a6c commit 5243e7b
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions drivers/net/hyperv/rndis_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -804,18 +804,15 @@ int rndis_filter_device_add(struct hv_device *dev,
/* Send the rndis initialization message */
ret = rndis_filter_init_device(rndis_device);
if (ret != 0) {
/*
* TODO: If rndis init failed, we will need to shut down the
* channel
*/
rndis_filter_device_remove(dev);
return ret;
}

/* Get the mac address */
ret = rndis_filter_query_device_mac(rndis_device);
if (ret != 0) {
/*
* TODO: shutdown rndis device and the channel
*/
rndis_filter_device_remove(dev);
return ret;
}

memcpy(device_info->mac_adr, rndis_device->hw_mac_adr, ETH_ALEN);
Expand Down

0 comments on commit 5243e7b

Please sign in to comment.