diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2019-08-19 12:58:14 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-08-29 08:28:59 +0200 |
commit | 0d5e34c1e2633e6256826b8ae2f7fe0d6b3b45d1 (patch) | |
tree | 4d8b1b4d7677484f8f1ed6a4ae1be0ce298944e7 /drivers/md | |
parent | 655bb2c4ace4ef3b34791b3ca4cc45693f2c0ecd (diff) | |
download | linux-stable-0d5e34c1e2633e6256826b8ae2f7fe0d6b3b45d1.tar.gz linux-stable-0d5e34c1e2633e6256826b8ae2f7fe0d6b3b45d1.tar.bz2 linux-stable-0d5e34c1e2633e6256826b8ae2f7fe0d6b3b45d1.zip |
dm zoned: fix potential NULL dereference in dmz_do_reclaim()
[ Upstream commit e0702d90b79d430b0ccc276ead4f88440bb51352 ]
This function is supposed to return error pointers so it matches the
dmz_get_rnd_zone_for_reclaim() function. The current code could lead to
a NULL dereference in dmz_do_reclaim()
Fixes: b234c6d7a703 ("dm zoned: improve error handling in reclaim")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/dm-zoned-metadata.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/dm-zoned-metadata.c b/drivers/md/dm-zoned-metadata.c index 00e7a343eacf..7e8d7fc99410 100644 --- a/drivers/md/dm-zoned-metadata.c +++ b/drivers/md/dm-zoned-metadata.c @@ -1579,7 +1579,7 @@ static struct dm_zone *dmz_get_seq_zone_for_reclaim(struct dmz_metadata *zmd) struct dm_zone *zone; if (list_empty(&zmd->map_seq_list)) - return NULL; + return ERR_PTR(-EBUSY); list_for_each_entry(zone, &zmd->map_seq_list, link) { if (!zone->bzone) @@ -1588,7 +1588,7 @@ static struct dm_zone *dmz_get_seq_zone_for_reclaim(struct dmz_metadata *zmd) return zone; } - return NULL; + return ERR_PTR(-EBUSY); } /* |