nvme: Do not return in the middle of the subcommand
To make nvme-cli subcommand return a mapped errno value to main(), it
should return the error status in a single place because it would be
great if the return statements and free operations are in an one shot
place.
This patch makes all the subcommands in nvme module return the error
which means internal error which should be in negative and nvme error
status which is in positive at the end of the subcommand.
Most of the changed parts are file descriptors which is returned from
parse_and_open() function. The "fd" could be in a negative value so
that it needs to be mapped to a uniformed errno value which will be
applied by the next patches.
Cc: Keith Busch <kbusch@kernel.org> Cc: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com> Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> Reviewed-by: Sagi Grimberg <sagi@grimberg.me>