Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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: a43f72a ("phy: cadence: Sierra: Change MAX_LANES of Sierra to 16") Fixes: 44d30d6 ("phy: cadence: Add driver for Sierra PHY") Signed-off-by: Dan Carpenter <[email protected]> Link: https://lore.kernel.org/r/20220115115146.GC7552@kili Signed-off-by: Vinod Koul <[email protected]>
- Loading branch information