NFSD: Using free_conn free connection
authorKinglong Mee <kinglongmee@gmail.com>
Mon, 24 Mar 2014 03:56:59 +0000 (11:56 +0800)
committerWilly Tarreau <w@1wt.eu>
Fri, 10 Feb 2017 10:03:28 +0000 (11:03 +0100)
commit 3f42d2c428c724212c5f4249daea97e254eb0546 upstream.

Connection from alloc_conn must be freed through free_conn,
otherwise, the reference of svc_xprt will never be put.

Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
fs/nfsd/nfs4state.c

index 4a58afa99654e088792144addc9dfed0a36ba9a2..b0878e1921bed90fab99b81cf77ec1ac038510a8 100644 (file)
@@ -2193,7 +2193,8 @@ out:
        if (!list_empty(&clp->cl_revoked))
                seq->status_flags |= SEQ4_STATUS_RECALLABLE_STATE_REVOKED;
 out_no_session:
-       kfree(conn);
+       if (conn)
+               free_conn(conn);
        spin_unlock(&nn->client_lock);
        return status;
 out_put_session: