staging: lustre: ptlrpc: fix nrs cleanup
authorNiu Yawei <yawei.niu@intel.com>
Wed, 4 May 2016 14:28:58 +0000 (10:28 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 May 2016 12:01:14 +0000 (14:01 +0200)
commit2ff1d8fbba493538e0d0c4f0e2dcd9c4bb0eb21a
tree7adab4b52d75a289ec3cbbb157a99f4fe8e3bd88
parent4fd9a8e937368781ac830402a3bcb87646999946
staging: lustre: ptlrpc: fix nrs cleanup

When service start failed due to short of memory, the cleanup code
could operate on uninitialized structure and cause crash at the end.

This patch fix the nrs_svcpt_cleanup_locked() to perform cleanup only
on the nrs which has been properly initialized.

Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3772
Reviewed-on: http://review.whamcloud.com/7410
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/ptlrpc/nrs.c