Commit 2a4d75bf authored by Miroslav Lichvar's avatar Miroslav Lichvar Committed by David S. Miller

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: d463126e ("net: sock: extend SO_TIMESTAMPING for PHC binding")
Signed-off-by: default avatarMiroslav Lichvar <mlichvar@redhat.com>
Cc: Yangbo Lu <yangbo.lu@nxp.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3486eb77
...@@ -844,6 +844,8 @@ static int sock_timestamping_bind_phc(struct sock *sk, int phc_index) ...@@ -844,6 +844,8 @@ static int sock_timestamping_bind_phc(struct sock *sk, int phc_index)
} }
num = ethtool_get_phc_vclocks(dev, &vclock_index); num = ethtool_get_phc_vclocks(dev, &vclock_index);
dev_put(dev);
for (i = 0; i < num; i++) { for (i = 0; i < num; i++) {
if (*(vclock_index + i) == phc_index) { if (*(vclock_index + i) == phc_index) {
match = true; match = true;
......
Markdown is supported
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