staging/lustre/ptlrpc: Fix a crash when dereferencing NULL pointer
staging/lustre/ptlrpc: Fix a crash when dereferencing NULL pointer

When a system runs out of memory and the function
ptlrpc_register_bulk() is called from ptl_send_rpc() the call to
LNetMEAttach() fails due to failure to allocate memory.  This forces
the code into an error path, which most probably previously went
untested.  The error path:
if (rc != 0) {
        CERROR("%s: LNetMEAttach failed x"LPU64"/%d: rc = %dn",
                desc->bd_export->exp_obd->obd_name, xid,
                posted_md, rc);
        break;
}
This print assumes that desc->bd_export is not NULL.  However, it is.
In fact it is expected to be NULL.  desc->bd_import is the correct
structure to access in this case.

Lustre-change: http://review.whamcloud.com/7121
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3585
Cc: stable <4fbacc2fa0ffdbb11bf1ad6925b886ebd08dd15f@vger.kernel.org> # 3.12
Signed-off-by: Amir Shehata <118e3ced9ae101fcd249ebc8b3a78bb4ebf30312@intel.com>
Reviewed-by: Liang Zhen <dac4a224165056eff68170aacb8742d53b293866@intel.com>
Reviewed-by: Doug Oucharek <58d568fe02b9a567c354f1788196313c4295e03f@intel.com>
Reviewed-by: Oleg Drokin <65b2ca07820e940f66d8901813c729ec10a548f5@intel.com>
Signed-off-by: Peng Tao <39d8af57313740070ea49547576f55682fe5221a@gmail.com>
Signed-off-by: Andreas Dilger <fb9bfcd2d82414390637ce05921b7d9f9341a408@intel.com>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs