Re: [PATCH][next] dm zoned: fix memory leak of newly allocated zone on xa_insert failure

2020-06-03 Thread Mike Snitzer
On Wed, Jun 03 2020 at 12:02pm -0400, Colin King wrote: > From: Colin Ian King > > Currently if an xa_insert fails then there is a memory lead of the > recently allocated zone object. Fix this by kfree'ing zone before > returning on the error return path. > > Addresses-Coverity: ("Resource lea

[PATCH][next] dm zoned: fix memory leak of newly allocated zone on xa_insert failure

2020-06-03 Thread Colin King
From: Colin Ian King Currently if an xa_insert fails then there is a memory lead of the recently allocated zone object. Fix this by kfree'ing zone before returning on the error return path. Addresses-Coverity: ("Resource leak") Fixes: 1a311efa3916 ("dm zoned: convert to xarray") Signed-off-by: C