From: Trond Myklebust Date: Wed, 29 Jan 2014 17:12:15 +0000 (-0500) Subject: NFSv4: Fix a slot leak in nfs40_sequence_done X-Git-Tag: v3.13.3~74 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=59a32b595cd6b8033731e83271fe9a6b463fb290;p=thirdparty%2Fkernel%2Fstable.git NFSv4: Fix a slot leak in nfs40_sequence_done commit cab92c19821a814ecf5a5279e2699bf28e66caee upstream. The check for whether or not we sent an RPC call in nfs40_sequence_done is insufficient to decide whether or not we are holding a session slot, and thus should not be used to decide when to free that slot. This patch replaces the RPC_WAS_SENT() test with the correct test for whether or not slot == NULL. Cc: Chuck Lever Signed-off-by: Trond Myklebust Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index c81d5d3bb6e40..96721814104c8 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -539,7 +539,7 @@ static int nfs40_sequence_done(struct rpc_task *task, struct nfs4_slot *slot = res->sr_slot; struct nfs4_slot_table *tbl; - if (!RPC_WAS_SENT(task)) + if (slot == NULL) goto out; tbl = slot->table;