net: mvneta: Fix err code path of probe
authorJisheng Zhang <Jisheng.Zhang@synaptics.com>
Mon, 27 May 2019 11:04:17 +0000 (11:04 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 9 Jun 2019 07:18:12 +0000 (09:18 +0200)
commitb9119b6a7ad996d5bff95df36cd08513b35cfab9
treec58ae5619fee3526165a0a9ed85ccc491fc73aae
parent163d73542aa44a6f00144d51528c8665aa4a8712
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>
drivers/net/ethernet/marvell/mvneta.c