dm zoned: fix potential NULL dereference in dmz_do_reclaim()
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 19 Aug 2019 09:58:14 +0000 (12:58 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Aug 2019 06:26:45 +0000 (08:26 +0200)
commit3d156087598d21db3a099da21dd39226549fbb2c
treed8d9c7e0ff26c25991580cbfd835cc9760a9879f
parent044d098441df8fabffba3b084a70beba0e77f8d4
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>
drivers/md/dm-zoned-metadata.c