net: ravb: Check return value of reset_control_deassert()
authorClaudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Tue, 28 Nov 2023 08:04:34 +0000 (10:04 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Dec 2023 07:52:23 +0000 (08:52 +0100)
commitc870191fc87c4c15ab6b7a2c72e1a98d29af9210
tree215f1d0e8ab595c603991bc6572ed4ee2d7fec1d
parentfd7f7a8ad3363fd94fc3868616cc70a1d8dfc01b
net: ravb: Check return value of reset_control_deassert()

[ Upstream commit d8eb6ea4b302e7ff78535c205510e359ac10a0bd ]

reset_control_deassert() could return an error. Some devices cannot work
if reset signal de-assert operation fails. To avoid this check the return
code of reset_control_deassert() in ravb_probe() and take proper action.

Along with it, the free_netdev() call from the error path was moved after
reset_control_assert() on its own label (out_free_netdev) to free
netdev in case reset_control_deassert() fails.

Fixes: 0d13a1a464a0 ("ravb: Add reset support")
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/renesas/ravb_main.c