Skip to content

Commit 835d89e

Browse files
tititiou36shligit
authored andcommitted
md-cluster: Fix a memleak in an error handling path
We know that 'bm_lockres' is NULL here, so 'lockres_free(bm_lockres)' is a no-op. According to resource handling in case of error a few lines below, it is likely that 'bitmap_free(bitmap)' was expected instead. Fixes: b98938d ("md-cluster: introduce cluster_check_sync_size") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: Guoqing Jiang <gqjiang@suse.com> Signed-off-by: Shaohua Li <shli@fb.com>
1 parent 78b6350 commit 835d89e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/md/md-cluster.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1127,7 +1127,7 @@ int cluster_check_sync_size(struct mddev *mddev)
11271127
bm_lockres = lockres_init(mddev, str, NULL, 1);
11281128
if (!bm_lockres) {
11291129
pr_err("md-cluster: Cannot initialize %s\n", str);
1130-
lockres_free(bm_lockres);
1130+
bitmap_free(bitmap);
11311131
return -1;
11321132
}
11331133
bm_lockres->flags |= DLM_LKF_NOQUEUE;

0 commit comments

Comments
 (0)