Protect against NULL imp
sptlrpc_import_sec_ref() should return NULL if imp is NULL
Existing callers can handle NULL returned from
sptlrpc_import_sec_ref() when imp is NULL
Signed-off-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Change-Id: I086cf835de7513f3a15d4ec3e4b907c3c6eae7bd
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/59903
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
{
struct ptlrpc_sec *sec;
+ if (IS_ERR_OR_NULL(imp))
+ return NULL;
+
read_lock(&imp->imp_sec_lock);
sec = sptlrpc_sec_get(imp->imp_sec);
read_unlock(&imp->imp_sec_lock);