diff options
author | Shaohua Li <shli@fb.com> | 2016-09-13 13:28:00 -0400 |
---|---|---|
committer | Shaohua Li <shli@fb.com> | 2016-09-21 12:09:44 -0400 |
commit | f71f1cf97c781db1be8ae0190e0983e1fceac14a (patch) | |
tree | 154a1cf49bf2697d6a311f42ec871b83c50267c8 /drivers/md/bitmap.c | |
parent | 1dffddddd8315863f1a6d79c512b737864ef6a1a (diff) |
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: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to 'drivers/md/bitmap.c')
-rw-r--r-- | drivers/md/bitmap.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index 13041ee37ad6..2d826927a3bf 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c | |||
@@ -1903,10 +1903,8 @@ int bitmap_copy_from_slot(struct mddev *mddev, int slot, | |||
1903 | struct bitmap_counts *counts; | 1903 | struct bitmap_counts *counts; |
1904 | struct bitmap *bitmap = bitmap_create(mddev, slot); | 1904 | struct bitmap *bitmap = bitmap_create(mddev, slot); |
1905 | 1905 | ||
1906 | if (IS_ERR(bitmap)) { | 1906 | if (IS_ERR(bitmap)) |
1907 | bitmap_free(bitmap); | ||
1908 | return PTR_ERR(bitmap); | 1907 | return PTR_ERR(bitmap); |
1909 | } | ||
1910 | 1908 | ||
1911 | rv = bitmap_init_from_disk(bitmap, 0); | 1909 | rv = bitmap_init_from_disk(bitmap, 0); |
1912 | if (rv) | 1910 | if (rv) |