diff options
author | Miroslav Lichvar <mlichvar@redhat.com> | 2022-01-11 16:10:53 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-01-12 14:16:15 +0000 |
commit | 2a4d75bfe41232608f5596a6d1369f92ccb20817 (patch) | |
tree | 529a98fbe5568ff77c801492ecb35e58b1d6731e | |
parent | 3486eb774f9d6c2cafcfed31936c9a9b7adf8f05 (diff) | |
download | linux-stable-2a4d75bfe41232608f5596a6d1369f92ccb20817.tar.gz linux-stable-2a4d75bfe41232608f5596a6d1369f92ccb20817.tar.bz2 linux-stable-2a4d75bfe41232608f5596a6d1369f92ccb20817.zip |
net: fix sock_timestamping_bind_phc() to release device
Don't forget to release the device in sock_timestamping_bind_phc() after
it was used to get the vclock indices.
Fixes: d463126e23f1 ("net: sock: extend SO_TIMESTAMPING for PHC binding")
Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
Cc: Yangbo Lu <yangbo.lu@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/core/sock.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/core/sock.c b/net/core/sock.c index e21485ab285d..f32ec08a0c37 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -844,6 +844,8 @@ static int sock_timestamping_bind_phc(struct sock *sk, int phc_index) } num = ethtool_get_phc_vclocks(dev, &vclock_index); + dev_put(dev); + for (i = 0; i < num; i++) { if (*(vclock_index + i) == phc_index) { match = true; |