]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
marvell: pxa168_eth: fix call balance of pep->clk handling routines
authorVitalii Mordan <mordan@ispras.ru>
Thu, 21 Nov 2024 20:06:58 +0000 (23:06 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2024 09:59:37 +0000 (10:59 +0100)
commitfa3be3e464fde3fd699344403edd662e103f37a7
treee73147c3bff23ee2505346e8d1f08be50a1898ef
parent72fbd71c6c56cbbdfb3bdc085a83124de3b63b3e
marvell: pxa168_eth: fix call balance of pep->clk handling routines

[ Upstream commit b032ae57d4fe2b2445e3bc190db6fcaa8c102f68 ]

If the clock pep->clk was not enabled in pxa168_eth_probe,
it should not be disabled in any path.

Conversely, if it was enabled in pxa168_eth_probe, it must be disabled
in all error paths to ensure proper cleanup.

Use the devm_clk_get_enabled helper function to ensure proper call balance
for pep->clk.

Found by Linux Verification Center (linuxtesting.org) with Klever.

Fixes: a49f37eed22b ("net: add Fast Ethernet driver for PXA168.")
Signed-off-by: Vitalii Mordan <mordan@ispras.ru>
Link: https://patch.msgid.link/20241121200658.2203871-1-mordan@ispras.ru
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/marvell/pxa168_eth.c