[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220111151053.4112161-1-mlichvar@redhat.com>
Date: Tue, 11 Jan 2022 16:10:53 +0100
From: Miroslav Lichvar <mlichvar@...hat.com>
To: netdev@...r.kernel.org
Cc: Miroslav Lichvar <mlichvar@...hat.com>,
Yangbo Lu <yangbo.lu@....com>
Subject: [PATCH net] 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@...hat.com>
Cc: Yangbo Lu <yangbo.lu@....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
Powered by blists - more mailing lists