mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 22:21:40 +00:00
dm zoned: fix uninitialized pointer dereference
Make sure that the local variable rzone in dmz_do_reclaim() is always
initialized before being used for printing debug messages.
Fixes: f97809aec5
("dm zoned: per-device reclaim")
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
This commit is contained in:
parent
b3a9e3b962
commit
c69cb1d17b
@ -377,6 +377,7 @@ static int dmz_do_reclaim(struct dmz_reclaim *zrc)
|
||||
dmz_metadata_label(zmd), zrc->dev_idx);
|
||||
return -EBUSY;
|
||||
}
|
||||
rzone = dzone;
|
||||
|
||||
start = jiffies;
|
||||
if (dmz_is_cache(dzone) || dmz_is_rnd(dzone)) {
|
||||
@ -391,8 +392,6 @@ static int dmz_do_reclaim(struct dmz_reclaim *zrc)
|
||||
*/
|
||||
ret = dmz_reclaim_rnd_data(zrc, dzone);
|
||||
}
|
||||
rzone = dzone;
|
||||
|
||||
} else {
|
||||
struct dm_zone *bzone = dzone->bzone;
|
||||
sector_t chunk_block = 0;
|
||||
@ -415,7 +414,6 @@ static int dmz_do_reclaim(struct dmz_reclaim *zrc)
|
||||
* be later reclaimed.
|
||||
*/
|
||||
ret = dmz_reclaim_seq_data(zrc, dzone);
|
||||
rzone = dzone;
|
||||
}
|
||||
}
|
||||
out:
|
||||
|
Loading…
Reference in New Issue
Block a user