From 6646307454ff710bcff5df71de398e60b00f494e Mon Sep 17 00:00:00 2001 From: Liang Zhen Date: Mon, 27 Apr 2015 10:49:41 +0800 Subject: [PATCH] LU-6480 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 Change-Id: Icc567593f50fd557d5a7d1642a65d4fe49e8b4c2 Reviewed-on: http://review.whamcloud.com/14603 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Isaac Huang Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- lnet/klnds/o2iblnd/o2iblnd.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lnet/klnds/o2iblnd/o2iblnd.c b/lnet/klnds/o2iblnd/o2iblnd.c index 32c455b..c02b733 100644 --- a/lnet/klnds/o2iblnd/o2iblnd.c +++ b/lnet/klnds/o2iblnd/o2iblnd.c @@ -2577,13 +2577,9 @@ 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; - } - - return 1; + rc = dev->ibd_hdev->ibh_ibdev != cmid->device; /* true for failover */ + rdma_destroy_id(cmid); + return rc; } int -- 1.8.3.1