Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f71f1cf9 authored by Shaohua Li's avatar Shaohua Li
Browse files

md/bitmap: fix wrong cleanup



if bitmap_create fails, the bitmap is already cleaned up and the returned value
is an error number. We can't do the cleanup again.

Reported-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: default avatarShaohua Li <shli@fb.com>
parent 1dffdddd
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -1903,10 +1903,8 @@ int bitmap_copy_from_slot(struct mddev *mddev, int slot,
	struct bitmap_counts *counts;
	struct bitmap *bitmap = bitmap_create(mddev, slot);

	if (IS_ERR(bitmap)) {
		bitmap_free(bitmap);
	if (IS_ERR(bitmap))
		return PTR_ERR(bitmap);
	}

	rv = bitmap_init_from_disk(bitmap, 0);
	if (rv)