]> www.infradead.org Git - users/sagi/nvme-cli.git/commit
nvme-topology: fix returning invalid value in scan_subsystems()
authorMinwoo Im <minwoo.im.dev@gmail.com>
Sat, 23 Jan 2021 07:21:46 +0000 (16:21 +0900)
committerKeith Busch <kbusch@kernel.org>
Tue, 26 Jan 2021 21:03:05 +0000 (14:03 -0700)
commit9f9e9352b6c2629d68aa9e8f5046ca9a6d6efed2
treeb8cc9e18c39b162deb3c75a3959093ce69db45f6
parent33c61eb871a5f34cd6e258475ee4fa95273e9e8c
nvme-topology: fix returning invalid value in scan_subsystems()

Let's say we have multiple three subsystems in the system.  If we run
a simple 'nvme list' command, then scan_subsystems() will never set the
'ret' value which is a local variable.  This should be initialized to a
initial value to avoid invalid value returning.

This patch fixes returning invalid value from the scan_subsystems() in
case of multi-subsystems found.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
nvme-topology.c