Skip to content
Commit cbda1b16 authored by Marek Behún's avatar Marek Behún Committed by Jakub Kicinski
Browse files

phylib: fix potential use-after-free



Commit bafbdd52 ("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: bafbdd52 ("phylib: Add device reset GPIO support")
Signed-off-by: default avatarMarek Behún <kabel@kernel.org>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20220119162748.32418-1-kabel@kernel.org


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 57afdc0a
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment