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)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 26 Nov 2024 10:49:51 +0000 (11:49 +0100)
commitb032ae57d4fe2b2445e3bc190db6fcaa8c102f68
tree780efa48685d20ec2f07dc9d61fc606153d9416f
parent9cc8d0ecdd2aad42e377e971e3bb114339df609e
marvell: pxa168_eth: fix call balance of pep->clk handling routines

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>
drivers/net/ethernet/marvell/pxa168_eth.c