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: d463126e23 ("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>
This commit is contained in:
Miroslav Lichvar 2022-01-11 16:10:53 +01:00 committed by David S. Miller
parent 3486eb774f
commit 2a4d75bfe4
1 changed files with 2 additions and 0 deletions

View File

@ -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;