]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
eth: bcmsysport: fix call balance of priv->clk handling routines
authorVitalii Mordan <mordan@ispras.ru>
Fri, 27 Dec 2024 12:30:07 +0000 (15:30 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jan 2025 12:28:46 +0000 (13:28 +0100)
commit36c95bbd4eb1ff040e6fef5ba06df32f3eb91238
tree0da039c467546be6d57f02177f3e2c6fae2a28ed
parentd27088892b401ff74b0de237b7deeb9d2f6289da
eth: bcmsysport: fix call balance of priv->clk handling routines

[ Upstream commit b255ef45fcc2141c1bf98456796abb956d843a27 ]

Check the return value of clk_prepare_enable to ensure that priv->clk has
been successfully enabled.

If priv->clk was not enabled during bcm_sysport_probe, bcm_sysport_resume,
or bcm_sysport_open, it must not be disabled in any subsequent execution
paths.

Fixes: 31bc72d97656 ("net: systemport: fetch and use clock resources")
Signed-off-by: Vitalii Mordan <mordan@ispras.ru>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://patch.msgid.link/20241227123007.2333397-1-mordan@ispras.ru
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/broadcom/bcmsysport.c