• Tom Rix's avatar
    nfs: Fix memory leak of export_path · 4659ed7c
    Tom Rix authored
    The try_location function is called within a loop by nfs_follow_referral.
    try_location calls nfs4_pathname_string to created the export_path.
    nfs4_pathname_string allocates the memory. export_path is stored in the
    nfs_fs_context/fs_context structure similarly as hostname and source.
    But whereas the ctx hostname and source are freed before assignment,
    export_path is not.  So if there are multiple loops, the new export_path
    will overwrite the old without the old being freed.
    
    So call kfree for export_path.
    Signed-off-by: default avatarTom Rix <trix@redhat.com>
    Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
    4659ed7c
nfs4namespace.c 13.5 KB