All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] md-cluster: fix missing memory free
@ 2016-01-23  0:45 Shaohua Li
  2016-01-23  0:45 ` [PATCH 2/2] md-cluster: delete useless code Shaohua Li
  2016-01-25  1:33 ` [PATCH 1/2] md-cluster: fix missing memory free Guoqing Jiang
  0 siblings, 2 replies; 4+ messages in thread
From: Shaohua Li @ 2016-01-23  0:45 UTC (permalink / raw)
  To: linux-raid; +Cc: Goldwyn Rodrigues, Guoqing Jiang, NeilBrown

There are several places we allocate dlm_lock_resource, but not free it.

Cc: Goldwyn Rodrigues <rgoldwyn@suse.com>
Cc: Guoqing Jiang <gqjiang@suse.com>
Cc: NeilBrown <neilb@suse.com>
Signed-off-by: Shaohua Li <shli@fb.com>
---
 drivers/md/md-cluster.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/md/md-cluster.c b/drivers/md/md-cluster.c
index 0ded8e9..662369c 100644
--- a/drivers/md/md-cluster.c
+++ b/drivers/md/md-cluster.c
@@ -293,6 +293,7 @@ static void recover_bitmaps(struct md_thread *thread)
 dlm_unlock:
 		dlm_unlock_sync(bm_lockres);
 clear_bit:
+		lockres_free(bm_lockres);
 		clear_bit(slot, &cinfo->recovery_map);
 	}
 }
@@ -682,8 +683,10 @@ static int gather_all_resync_info(struct mddev *mddev, int total_slots)
 		bm_lockres = lockres_init(mddev, str, NULL, 1);
 		if (!bm_lockres)
 			return -ENOMEM;
-		if (i == (cinfo->slot_number - 1))
+		if (i == (cinfo->slot_number - 1)) {
+			lockres_free(bm_lockres);
 			continue;
+		}
 
 		bm_lockres->flags |= DLM_LKF_NOQUEUE;
 		ret = dlm_lock_sync(bm_lockres, DLM_LOCK_PW);
-- 
2.4.6


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-01-25  1:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-23  0:45 [PATCH 1/2] md-cluster: fix missing memory free Shaohua Li
2016-01-23  0:45 ` [PATCH 2/2] md-cluster: delete useless code Shaohua Li
2016-01-25  1:40   ` Guoqing Jiang
2016-01-25  1:33 ` [PATCH 1/2] md-cluster: fix missing memory free Guoqing Jiang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.