diff options
author | David S. Miller <davem@davemloft.net> | 2014-01-06 17:37:45 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-01-06 17:37:45 -0500 |
commit | 56a4342dfe3145cd66f766adccb28fd9b571606d (patch) | |
tree | d1593764488ff8cbb0b83cb9ae35fd968bf81760 /drivers/net/hyperv | |
parent | 805c1f4aedaba1bc8d839e7c27b128083dd5c2f0 (diff) | |
parent | fe0d692bbc645786bce1a98439e548ae619269f5 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c
net/ipv6/ip6_tunnel.c
net/ipv6/ip6_vti.c
ipv6 tunnel statistic bug fixes conflicting with consolidation into
generic sw per-cpu net stats.
qlogic conflict between queue counting bug fix and the addition
of multiple MAC address support.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/hyperv')
-rw-r--r-- | drivers/net/hyperv/netvsc_drv.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index f80bd0c90f1e..7756118c2f0a 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c | |||
@@ -260,9 +260,7 @@ int netvsc_recv_callback(struct hv_device *device_obj, | |||
260 | struct sk_buff *skb; | 260 | struct sk_buff *skb; |
261 | 261 | ||
262 | net = ((struct netvsc_device *)hv_get_drvdata(device_obj))->ndev; | 262 | net = ((struct netvsc_device *)hv_get_drvdata(device_obj))->ndev; |
263 | if (!net) { | 263 | if (!net || net->reg_state != NETREG_REGISTERED) { |
264 | netdev_err(net, "got receive callback but net device" | ||
265 | " not initialized yet\n"); | ||
266 | packet->status = NVSP_STAT_FAIL; | 264 | packet->status = NVSP_STAT_FAIL; |
267 | return 0; | 265 | return 0; |
268 | } | 266 | } |
@@ -434,19 +432,11 @@ static int netvsc_probe(struct hv_device *dev, | |||
434 | SET_ETHTOOL_OPS(net, ðtool_ops); | 432 | SET_ETHTOOL_OPS(net, ðtool_ops); |
435 | SET_NETDEV_DEV(net, &dev->device); | 433 | SET_NETDEV_DEV(net, &dev->device); |
436 | 434 | ||
437 | ret = register_netdev(net); | ||
438 | if (ret != 0) { | ||
439 | pr_err("Unable to register netdev.\n"); | ||
440 | free_netdev(net); | ||
441 | goto out; | ||
442 | } | ||
443 | |||
444 | /* Notify the netvsc driver of the new device */ | 435 | /* Notify the netvsc driver of the new device */ |
445 | device_info.ring_size = ring_size; | 436 | device_info.ring_size = ring_size; |
446 | ret = rndis_filter_device_add(dev, &device_info); | 437 | ret = rndis_filter_device_add(dev, &device_info); |
447 | if (ret != 0) { | 438 | if (ret != 0) { |
448 | netdev_err(net, "unable to add netvsc device (ret %d)\n", ret); | 439 | netdev_err(net, "unable to add netvsc device (ret %d)\n", ret); |
449 | unregister_netdev(net); | ||
450 | free_netdev(net); | 440 | free_netdev(net); |
451 | hv_set_drvdata(dev, NULL); | 441 | hv_set_drvdata(dev, NULL); |
452 | return ret; | 442 | return ret; |
@@ -455,7 +445,13 @@ static int netvsc_probe(struct hv_device *dev, | |||
455 | 445 | ||
456 | netif_carrier_on(net); | 446 | netif_carrier_on(net); |
457 | 447 | ||
458 | out: | 448 | ret = register_netdev(net); |
449 | if (ret != 0) { | ||
450 | pr_err("Unable to register netdev.\n"); | ||
451 | rndis_filter_device_remove(dev); | ||
452 | free_netdev(net); | ||
453 | } | ||
454 | |||
459 | return ret; | 455 | return ret; |
460 | } | 456 | } |
461 | 457 | ||