Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH net] net: fix sock_timestamping_bind_phc() to release device
@ 2022-01-11 15:10 Miroslav Lichvar
  2022-01-12 14:20 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Miroslav Lichvar @ 2022-01-11 15:10 UTC (permalink / raw)
  To: netdev; +Cc: Miroslav Lichvar, Yangbo Lu

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>
---
 net/core/sock.c | 2 ++
 1 file changed, 2 insertions(+)

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] net: fix sock_timestamping_bind_phc() to release device
  2022-01-11 15:10 [PATCH net] net: fix sock_timestamping_bind_phc() to release device Miroslav Lichvar
@ 2022-01-12 14:20 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-01-12 14:20 UTC (permalink / raw)
  To: Miroslav Lichvar; +Cc: netdev, yangbo.lu

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:

On Tue, 11 Jan 2022 16:10:53 +0100 you wrote:
> 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>
> 
> [...]

Here is the summary with links:
  - [net] net: fix sock_timestamping_bind_phc() to release device
    https://git.kernel.org/netdev/net/c/2a4d75bfe412

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-01-12 14:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-11 15:10 [PATCH net] net: fix sock_timestamping_bind_phc() to release device Miroslav Lichvar
2022-01-12 14:20 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).