nvme-pci: fix CMB sysfs file removal in reset path
authorMax Gurtovoy <maxg@mellanox.com>
Sat, 29 Jul 2017 22:45:08 +0000 (01:45 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 10 Nov 2018 15:42:46 +0000 (07:42 -0800)
commit3cd731e952df562312ea1a7c459807382acb9f8b
tree4594278febd06c1a1b3aa1a48e191e62a1341289
parente7d5fa96ef7bee036b751af01f62ade7d482b13d
nvme-pci: fix CMB sysfs file removal in reset path

[ Upstream commit 1c78f7735b2bdd0afbe5d14c5c8b6d8d381b6f13 ]

Currently we create the sysfs entry even if we fail mapping
it. In that case, the unmapping will not remove the sysfs created
file. There is no good reason to create a sysfs entry for a non
working CMB and show his characteristics.

Fixes: f63572dff ("nvme: unmap CMB and remove sysfs file in reset path")
Signed-off-by: Max Gurtovoy <maxg@mellanox.com>
Reviewed-by: Stephen Bates <sbates@raithlin.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvme/host/pci.c