lkml.org 
[lkml]   [2022]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.16 1008/1039] net: fix sock_timestamping_bind_phc() to release device
    Date
    From: Miroslav Lichvar <mlichvar@redhat.com>

    commit 2a4d75bfe41232608f5596a6d1369f92ccb20817 upstream.

    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>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    net/core/sock.c | 2 ++
    1 file changed, 2 insertions(+)

    --- a/net/core/sock.c
    +++ b/net/core/sock.c
    @@ -843,6 +843,8 @@ static int sock_timestamping_bind_phc(st
    }

    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;

    \
     
     \ /
      Last update: 2022-01-25 03:56    [W:4.436 / U:0.532 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site