nfsd: correctly decrement odstate refcount in error path
authorAndrew Elble <aweits@rit.edu>
Fri, 5 Oct 2018 13:32:08 +0000 (09:32 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Nov 2018 19:08:49 +0000 (11:08 -0800)
commitb71f9663a7babdefdc54c7fdb83e89d2b2b9ec42
treeb7be1572acfb068666a6a5f0a8eecbf8f56191c5
parentd99bbbf1eedd99af73a869f11ae13392331b1aa9
nfsd: correctly decrement odstate refcount in error path

commit bd8d725078867cda250fe94b9c5a067b4a64ca74 upstream.

alloc_init_deleg() both allocates an nfs4_delegation, and
bumps the refcount on odstate. So after this point, we need to
put_clnt_odstate() and nfs4_put_stid() to not leave the odstate
refcount inappropriately bumped.

Signed-off-by: Andrew Elble <aweits@rit.edu>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfsd/nfs4state.c