• Ursula Braun's avatar
    net/smc: fix closing of fallback SMC sockets · f536dffc
    Ursula Braun authored
    For SMC sockets forced to fallback to TCP, the file is propagated
    from the outer SMC to the internal TCP socket. When closing the SMC
    socket, the internal TCP socket file pointer must be restored to the
    original NULL value, otherwise memory leaks may show up (found with
    CONFIG_DEBUG_KMEMLEAK).
    
    The internal TCP socket is released in smc_clcsock_release(), which
    calls __sock_release() function in net/socket.c. This calls the
    needed iput(SOCK_INODE(sock)) only, if the file pointer has been reset
    to the original NULL-value.
    
    Fixes: 07603b23 ("net/smc: propagate file from SMC to TCP socket")
    Signed-off-by: default avatarUrsula Braun <ubraun@linux.ibm.com>
    Signed-off-by: default avatarKarsten Graul <kgraul@linux.ibm.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    f536dffc
af_smc.c 52.4 KB