# Re: \[PATCH\] md/bitmap: call bitmap\_file\_unmap once bitmap\_storage\_alloc returns -ENOMEM

- From: Shaohua Li \<shli@kernel.org\>
- Date: 2016-11-04 20:19:54 
- List: linux-raid
- Page: https://ratatoskr.run/linux-raid/2016/11/6633334
- Thread: https://ratatoskr.run/linux-raid/2016/10/6633258/t.md

```text
On Mon, Oct 31, 2016 at 10:19:00AM +0800, Guoqing Jiang wrote:
> 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 <redacted>
> Signed-off-by: Guoqing Jiang <redacted>

thanks, applied.
```
