linux-stable/drivers/phy/cadence
Dan Carpenter 29afbd769c phy: cadence: Sierra: fix error handling bugs in probe()
There are two bugs in the error handling:
1: If devm_of_phy_provider_register() fails then there was no cleanup.
2: The error handling called of_node_put(child) improperly leading to
   a use after free.  We are only holding the reference inside the loop
   so the last two gotos after the loop lead to a use after free bug.
   Fix this by cleaning up the partial allocations (or partial iterations)
   in the loop before doing the goto.

Fixes: a43f72ae13 ("phy: cadence: Sierra: Change MAX_LANES of Sierra to 16")
Fixes: 44d30d6228 ("phy: cadence: Add driver for Sierra PHY")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20220115115146.GC7552@kili
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2022-01-24 09:35:31 +05:30
..
Kconfig phy: cadence: Sierra: Model PLL_CMNLC and PLL_CMNLC1 as clocks (mux clocks) 2021-03-31 16:43:21 +05:30
Makefile phy: cadence: salvo: add salvo phy driver 2020-05-07 09:46:36 +05:30
cdns-dphy.c phy: cadence: convert to devm_platform_ioremap_resource 2020-11-16 12:47:46 +05:30
phy-cadence-salvo.c phy: cadence: convert to devm_platform_ioremap_resource 2020-11-16 12:47:46 +05:30
phy-cadence-sierra.c phy: cadence: Sierra: fix error handling bugs in probe() 2022-01-24 09:35:31 +05:30
phy-cadence-torrent.c phy: cadence-torrent: use swap() to make code cleaner 2021-11-23 11:24:30 +05:30