md/bitmap: call bitmap_file_unmap once bitmap_storage_alloc returns -ENOMEM
authorGuoqing Jiang <gqjiang@suse.com>
Mon, 31 Oct 2016 02:19:00 +0000 (10:19 +0800)
committerShaohua Li <shli@fb.com>
Mon, 7 Nov 2016 23:08:21 +0000 (15:08 -0800)
commitcbb387323610295be9d36c51287b668c1140704f
treeb697134a5e51559f4ab83d440825f10316f4dfb4
parent7adb072ca83d71103ecc8578bee5f73c4f1eba89
md/bitmap: call bitmap_file_unmap once bitmap_storage_alloc returns -ENOMEM

It is possible that bitmap_storage_alloc could return -ENOMEM,
and some member inside store could be allocated such as filemap.

To avoid memory leak, we need to call bitmap_file_unmap to free
those members in the bitmap_resize.

Reviewed-by: NeilBrown <neilb@suse.com>
Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
Signed-off-by: Shaohua Li <shli@fb.com>
drivers/md/bitmap.c