nvme-pci: Fix an error handling path in 'nvme_probe()'
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 16 Jul 2017 08:39:03 +0000 (10:39 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Sep 2021 09:42:57 +0000 (11:42 +0200)
commitda6fe93816dac3521d5bb8309d83707f042d4b5c
treeae2ba00e66225bd49c818e06308de4eba811bde6
parent4bd472863d342f18930e2916dd9c8ed466c44caf
nvme-pci: Fix an error handling path in 'nvme_probe()'

commit b00c9b7aa06786fc5469783965ff3e2a705a1dec upstream.

Release resources in the correct order in order not to miss a
'put_device()' if 'nvme_dev_map()' fails.

Fixes: b00a726a9fd8 ("NVMe: Don't unmap controller registers on reset")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nvme/host/pci.c