lkml.org 
[lkml]   [2020]   [May]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.4 267/312] rtnl: reset calcit fptr in rtnl_unregister()
    Date
    From: Mathias Krause <minipli@googlemail.com>

    commit f567e950bf51290755a2539ff2aaef4c26f735d3 upstream.

    To avoid having dangling function pointers left behind, reset calcit in
    rtnl_unregister(), too.

    This is no issue so far, as only the rtnl core registers a netlink
    handler with a calcit hook which won't be unregistered, but may become
    one if new code makes use of the calcit hook.

    Fixes: c7ac8679bec9 ("rtnetlink: Compute and store minimum ifinfo...")
    Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
    Cc: Greg Rose <gregory.v.rose@intel.com>
    Signed-off-by: Mathias Krause <minipli@googlemail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    net/core/rtnetlink.c | 1 +
    1 file changed, 1 insertion(+)

    --- a/net/core/rtnetlink.c
    +++ b/net/core/rtnetlink.c
    @@ -253,6 +253,7 @@ int rtnl_unregister(int protocol, int ms

    rtnl_msg_handlers[protocol][msgindex].doit = NULL;
    rtnl_msg_handlers[protocol][msgindex].dumpit = NULL;
    + rtnl_msg_handlers[protocol][msgindex].calcit = NULL;

    return 0;
    }

    \
     
     \ /
      Last update: 2020-05-08 15:14    [W:4.166 / U:0.888 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site