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

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
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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;