net: stmicro: handle clk_prepare() failure during init
authorAnirudh Rayabharam <mail@anirudhrb.com>
Mon, 3 May 2021 11:56:48 +0000 (13:56 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 May 2021 10:06:56 +0000 (12:06 +0200)
commit0eb496c3c103b2dcb830aa245b69cd27f4fc70b9
treefb49edf8a80ed9ced77dd0c446a1a216e8d99bc6
parentc89c9a291149468b42292718047e5e891a517b97
net: stmicro: handle clk_prepare() failure during init

commit 0c32a96d000f260b5ebfabb4145a86ae1cd71847 upstream.

In case clk_prepare() fails, capture and propagate the error code up the
stack. If regulator_enable() was called earlier, properly unwind it by
calling regulator_disable().

Signed-off-by: Anirudh Rayabharam <mail@anirudhrb.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210503115736.2104747-22-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c