diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2016-05-16 17:42:42 -0400 |
---|---|---|
committer | Anna Schumaker <Anna.Schumaker@Netapp.com> | 2016-05-17 15:48:06 -0400 |
commit | 9a8f6b5ea275ff01fc8ef3b8630a3d4ed6b0a362 (patch) | |
tree | 5016f7b85eb31806fca6e96e473ce60b3b631b58 /include/linux/sunrpc | |
parent | f538d0ba5be39c52addff01c7ec31f0b90e57dfc (diff) | |
download | lwn-9a8f6b5ea275ff01fc8ef3b8630a3d4ed6b0a362.tar.gz lwn-9a8f6b5ea275ff01fc8ef3b8630a3d4ed6b0a362.zip |
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>
Diffstat (limited to 'include/linux/sunrpc')
-rw-r--r-- | include/linux/sunrpc/auth.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h index 6f36b2bf3e05..899791573a40 100644 --- a/include/linux/sunrpc/auth.h +++ b/include/linux/sunrpc/auth.h @@ -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; } |