mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 12:25:00 -04:00
net: gianfar: fix device leak when querying time stamp info
commit da717540acd34e5056e3fa35791d50f6b3303f55 upstream.
Make sure to drop the reference to the ptp device taken by
of_find_device_by_node() when querying the time stamping capabilities.
Note that holding a reference to the ptp device does not prevent its
driver data from going away.
Fixes: 7349a74ea7 ("net: ethernet: gianfar_ethtool: get phc index through drvdata")
Cc: stable@vger.kernel.org # 4.18
Cc: Yangbo Lu <yangbo.lu@nxp.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250725171213.880-4-johan@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
47d49fd07f
commit
aecfeb82dd
1 changed files with 3 additions and 1 deletions
|
|
@ -1490,8 +1490,10 @@ static int gfar_get_ts_info(struct net_device *dev,
|
|||
if (ptp_node) {
|
||||
ptp_dev = of_find_device_by_node(ptp_node);
|
||||
of_node_put(ptp_node);
|
||||
if (ptp_dev)
|
||||
if (ptp_dev) {
|
||||
ptp = platform_get_drvdata(ptp_dev);
|
||||
put_device(&ptp_dev->dev);
|
||||
}
|
||||
}
|
||||
|
||||
if (ptp)
|
||||
|
|
|
|||
Loading…
Reference in a new issue