block: fix zones_cond memory leak in blk_revalidate_disk_zones()#708
block: fix zones_cond memory leak in blk_revalidate_disk_zones()#708blktests-ci[bot] wants to merge 1 commit intolinus-master_basefrom
Conversation
|
Upstream branch: 7aaa804 |
|
Upstream branch: 7aaa804 |
0a7035b to
8d51a57
Compare
c781e1e to
255b4bf
Compare
|
Upstream branch: d0c3bcd |
8d51a57 to
6afb49e
Compare
255b4bf to
3236861
Compare
|
Upstream branch: 9147566 |
6afb49e to
d944c69
Compare
ecbdbb4 to
480b162
Compare
|
Upstream branch: 9147566 |
d944c69 to
a3224d2
Compare
a96fba7 to
0cd6ac2
Compare
|
Upstream branch: 9147566 |
a3224d2 to
49c4562
Compare
0cd6ac2 to
910d344
Compare
|
Upstream branch: d8a9a4b |
49c4562 to
8ca1c1e
Compare
910d344 to
ed862bc
Compare
|
Upstream branch: 7ca6d1c |
8ca1c1e to
a9604d1
Compare
ed862bc to
2d0c3d5
Compare
|
Upstream branch: 3aae938 |
a9604d1 to
e859be5
Compare
2d0c3d5 to
931d9b0
Compare
|
Upstream branch: 3036cd0 |
e859be5 to
fd80008
Compare
931d9b0 to
78a4682
Compare
|
Upstream branch: 9a9c8ce |
Fix memory leaks of args.zones_cond allocated in disk_revalidate_zone_resources() on multiple error paths: 1) When disk_revalidate_zone_resources() itself fails (e.g. disk_alloc_zone_resources() returns an error), blk_revalidate_disk_zones() returns directly without freeing args.zones_cond. 2) When report_zones() fails or the capacity check fails, disk_free_zone_resources() only frees the old disk->zones_cond, not the newly allocated args.zones_cond. 3) When the nr_conv_zones validation fails in disk_update_zone_resources(), the code jumps to unfreeze before disk_set_zones_cond_array() transfers ownership of args->zones_cond to disk->zones_cond. Fix this by freeing args->zones_cond at each error site: in blk_revalidate_disk_zones() when disk_revalidate_zone_resources() or zone reporting fails, and in disk_update_zone_resources() before jumping to the unfreeze label. Fixes: 6e945ff ("block: use zone condition to determine conventional zones") Signed-off-by: Jackie Liu <liuyun01@kylinos.cn>
fd80008 to
bb385be
Compare
Pull request for series with
subject: block: fix zones_cond memory leak in blk_revalidate_disk_zones()
version: 1
url: https://patchwork.kernel.org/project/linux-block/list/?series=1075054