diff options
author | Amir Shehata <amir.shehata@intel.com> | 2013-12-03 21:58:47 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-12-03 08:45:29 -0800 |
commit | 3c92a0bf4d72737035a16c4fe357ccd439c9b7d2 (patch) | |
tree | 7499ed57141bc7e240852b786ff954baa1957c84 /fs/ceph/file.c | |
parent | 56dba8cd9ac8cb59161b906a27b5a4260e6ee99f (diff) |
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 <stable@vger.kernel.org> # 3.12
Signed-off-by: Amir Shehata <amir.shehata@intel.com>
Reviewed-by: Liang Zhen <liang.zhen@intel.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/ceph/file.c')
0 files changed, 0 insertions, 0 deletions