diff options
author | Doug Oucharek <doug.s.oucharek@intel.com> | 2016-06-09 18:45:45 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-06-09 21:33:27 -0400 |
commit | a9cc4006155a68dd0940728f4f222dd035180904 (patch) | |
tree | b998a983f32cd735f546673bb37b66d0315e6453 | |
parent | 03cce00b4b0d70885c7a63ef17713b8cc2b1c8bd (diff) |
staging: lustre: lnet: Don't access NULL NI on failure path
In kiblnd_passive_connect(), if we are failing the connection
attempt because we cannot find a valid NI (we have a NULL NI),
we were coring after the "goto fail" because the failure
path was assuming non-NULL NI.
This patch ensures we don't dereference a NULL NI on that
failure path.
Signed-off-by: Doug Oucharek <doug.s.oucharek@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8022
Reviewed-on: http://review.whamcloud.com/19614
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Matt Ezell <ezellma@ornl.gov>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c index bbfee53cfcf5..845e49a52430 100644 --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c | |||
@@ -2521,12 +2521,13 @@ kiblnd_passive_connect(struct rdma_cm_id *cmid, void *priv, int priv_nob) | |||
2521 | return 0; | 2521 | return 0; |
2522 | 2522 | ||
2523 | failed: | 2523 | failed: |
2524 | if (ni) | 2524 | if (ni) { |
2525 | lnet_ni_decref(ni); | 2525 | lnet_ni_decref(ni); |
2526 | rej.ibr_cp.ibcp_queue_depth = kiblnd_msg_queue_size(version, ni); | ||
2527 | rej.ibr_cp.ibcp_max_frags = kiblnd_rdma_frags(version, ni); | ||
2528 | } | ||
2526 | 2529 | ||
2527 | rej.ibr_version = version; | 2530 | rej.ibr_version = version; |
2528 | rej.ibr_cp.ibcp_queue_depth = kiblnd_msg_queue_size(version, ni); | ||
2529 | rej.ibr_cp.ibcp_max_frags = kiblnd_rdma_frags(version, ni); | ||
2530 | kiblnd_reject(cmid, &rej); | 2531 | kiblnd_reject(cmid, &rej); |
2531 | 2532 | ||
2532 | return -ECONNREFUSED; | 2533 | return -ECONNREFUSED; |