Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
phylib: fix potential use-after-free
[ Upstream commit cbda1b1 ] Commit bafbdd5 ("phylib: Add device reset GPIO support") added call to phy_device_reset(phydev) after the put_device() call in phy_detach(). The comment before the put_device() call says that the phydev might go away with put_device(). Fix potential use-after-free by calling phy_device_reset() before put_device(). Fixes: bafbdd5 ("phylib: Add device reset GPIO support") Signed-off-by: Marek Behún <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
- Loading branch information