]> git.baikalelectronics.ru Git - kernel.git/commit
nvme-pci: set the errno on ctrl state change error
authorChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Sat, 8 Jun 2019 20:01:02 +0000 (13:01 -0700)
committerChristoph Hellwig <hch@lst.de>
Fri, 21 Jun 2019 09:08:38 +0000 (11:08 +0200)
commit8765c57d5663d3d51b44f823c519dbbc816fd9b9
treecb5e6f384c7cd778deef138dc3156e62768e7702
parent0f1d35f7970e8aa4d64865d2dd635a9192d3a057
nvme-pci: set the errno on ctrl state change error

This patch removes the confusing assignment of the variable result at
the time of declaration and sets the value in error cases next to the
places where the actual error is happening.

Here we also set the result value to -ENODEV when we fail at the final
ctrl state transition in nvme_reset_work(). Without this assignment
result will hold 0 from nvme_setup_io_queue() and on failure 0 will be
passed to he nvme_remove_dead_ctrl() from final state transition.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/pci.c