SUNRPC: Ensure get_rpccred() and put_rpccred() can take NULL arguments

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
Trond Myklebust 2016-05-16 17:42:42 -04:00 committed by Anna Schumaker
parent f538d0ba5b
commit 9a8f6b5ea2
2 changed files with 5 additions and 3 deletions

View file

@ -202,7 +202,8 @@ char * rpcauth_stringify_acceptor(struct rpc_cred *);
static inline
struct rpc_cred * get_rpccred(struct rpc_cred *cred)
{
atomic_inc(&cred->cr_count);
if (cred != NULL)
atomic_inc(&cred->cr_count);
return cred;
}