]> www.infradead.org Git - users/sagi/nvme-cli.git/commit
nvme: fix nvme get-feature with -H option
authorMartin George <marting@netapp.com>
Tue, 12 Jul 2022 08:31:08 +0000 (14:01 +0530)
committerMartin George <marting@netapp.com>
Tue, 12 Jul 2022 08:31:08 +0000 (14:01 +0530)
commitbbc007d43d367d038567e97066f0511c89205a82
tree8736a9ad2dfbc2591dba782e7c6c30c7ac90bfab
parent940f992be10d28ce484ac28f7781e95f38038596
nvme: fix nvme get-feature with -H option

Currently, nvme get-feature with the -H option fails to print detailed
info for specific feature ids such as number of IO queues (fid=0x07),
async event config (fid=0x0b), KATO value (fid=0x0f), etc. This is
because nvme_feature_show_fields() is invoked only if the corresponding
'buf' pointer is valid, which is not necessary for the above feature
ids. So fix this by removing this restriction while invoking
nvme_feature_show_fields(). At the same time, ensure this 'buf' pointer
is appropriately validated before use in this function.

Fixes: bcab212 ("nvme: coverity fixes")
Signed-off-by: Martin George <marting@netapp.com>
nvme-print.c
nvme.c