aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJisheng Zhang <Jisheng.Zhang@synaptics.com>2019-05-27 11:04:17 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-06-04 05:59:41 (GMT)
commit67a3fa2fd0e0df42af99aa0174672c5ee4588b3a (patch)
tree8e3153749d88e7f9143f3a2445fd94f5f5c6ce3e
parentd46ed35e51d206a20664b2f7beeb3eab9fd851b8 (diff)
downloadkernel_replicant_linux-67a3fa2fd0e0df42af99aa0174672c5ee4588b3a.zip
kernel_replicant_linux-67a3fa2fd0e0df42af99aa0174672c5ee4588b3a.tar.gz
kernel_replicant_linux-67a3fa2fd0e0df42af99aa0174672c5ee4588b3a.tar.bz2
net: mvneta: Fix err code path of probe
[ Upstream commit d484e06e25ebb937d841dac02ac1fe76ec7d4ddd ] Fix below issues in err code path of probe: 1. we don't need to unregister_netdev() because the netdev isn't registered. 2. when register_netdev() fails, we also need to destroy bm pool for HWBM case. Fixes: dc35a10f68d3 ("net: mvneta: bm: add support for hardware buffer management") Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/net/ethernet/marvell/mvneta.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index c0a3718..c7f4b72 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -4674,7 +4674,7 @@ static int mvneta_probe(struct platform_device *pdev)
err = register_netdev(dev);
if (err < 0) {
dev_err(&pdev->dev, "failed to register\n");
- goto err_free_stats;
+ goto err_netdev;
}
netdev_info(dev, "Using %s mac address %pM\n", mac_from,
@@ -4685,14 +4685,12 @@ static int mvneta_probe(struct platform_device *pdev)
return 0;
err_netdev:
- unregister_netdev(dev);
if (pp->bm_priv) {
mvneta_bm_pool_destroy(pp->bm_priv, pp->pool_long, 1 << pp->id);
mvneta_bm_pool_destroy(pp->bm_priv, pp->pool_short,
1 << pp->id);
mvneta_bm_put(pp->bm_priv);
}
-err_free_stats:
free_percpu(pp->stats);
err_free_ports:
free_percpu(pp->ports);