Re: [PATCH v2] ocfs2: Fix a use after free on error

2021-02-02 Thread Joseph Qi
On 2/2/21 7:32 PM, Dan Carpenter wrote: > The error handling in this function frees "reg" but it is still on the > "o2hb_all_regions" list so it will lead to a use after freew. Joseph Qi > points out that we need to clear the bit in the "o2hb_region_bitmap" as > well > > Fixes: 1cf257f51191 ("

[PATCH v2] ocfs2: Fix a use after free on error

2021-02-02 Thread Dan Carpenter
The error handling in this function frees "reg" but it is still on the "o2hb_all_regions" list so it will lead to a use after freew. Joseph Qi points out that we need to clear the bit in the "o2hb_region_bitmap" as well Fixes: 1cf257f51191 ("ocfs2: fix memory leak") Signed-off-by: Dan Carpenter