dm: fix alloc_dax error handling in alloc_dev
authorChristoph Hellwig <hch@lst.de>
Mon, 29 Nov 2021 10:21:35 +0000 (11:21 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 09:54:22 +0000 (10:54 +0100)
commitdfde7afed7116374074e531dfad9919348bef5ac
tree0de629db244f6b7d31e35296a4ccc26b8887d8b2
parent2e2086f49e08b73dbd47b5ef953083397f06209f
dm: fix alloc_dax error handling in alloc_dev

[ Upstream commit d751939235b9b7bc4af15f90a3e99288a8b844a7 ]

Make sure ->dax_dev is NULL on error so that the cleanup path doesn't
trip over an ERR_PTR.

Reported-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20211129102203.2243509-2-hch@lst.de
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/md/dm.c