summaryrefslogtreecommitdiff
path: root/drivers/staging/lustre/lnet
diff options
context:
space:
mode:
authorLiang Zhen <liang.zhen@intel.com>2015-09-14 22:41:33 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-09-15 13:26:55 (GMT)
commit199a0cc08d8552b9683150ef49ebceb764e436eb (patch)
tree7f747cae89231663e1a49bb86e6d5127caec24ec /drivers/staging/lustre/lnet
parentaefd9d714d5dc65b748e4f226475537ba6e00e86 (diff)
downloadlinux-199a0cc08d8552b9683150ef49ebceb764e436eb.tar.xz
staging/lustre/o2iblnd: leak cmid in kiblnd_dev_need_failover
cmid created by kiblnd_dev_need_failover should always be destroyed, however it is not the case in current implementation and we will leak cmid when this function detected a device failover. Signed-off-by: Liang Zhen <liang.zhen@intel.com> Reviewed-on: http://review.whamcloud.com/14603 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6480 Reviewed-by: Isaac Huang <he.huang@intel.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre/lnet')
-rw-r--r--drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
index c29d2ce..faa70f0 100644
--- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
+++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
@@ -2228,13 +2228,10 @@ static int kiblnd_dev_need_failover(kib_dev_t *dev)
return rc;
}
- if (dev->ibd_hdev->ibh_ibdev == cmid->device) {
- /* don't need device failover */
- rdma_destroy_id(cmid);
- return 0;
- }
+ rc = dev->ibd_hdev->ibh_ibdev != cmid->device; /* true for failover */
+ rdma_destroy_id(cmid);
- return 1;
+ return rc;
}
int kiblnd_dev_failover(kib_dev_t *dev)