nvmecontrol: Update the test for a valid firmare revision slot

Reported by:	Coverity Scan
CID:		1539214
Fixes:		7485926e09 nvme: Firmware revisions in the firmware slot info logpage are ASCII strings

(cherry picked from commit 1b38f851d8)
This commit is contained in:
John Baldwin 2024-03-15 08:18:47 -07:00
parent 4329e6ccfa
commit 661e3d4f15

View File

@ -105,7 +105,7 @@ slot_has_valid_firmware(int fd, int slot)
read_logpage(fd, NVME_LOG_FIRMWARE_SLOT,
NVME_GLOBAL_NAMESPACE_TAG, 0, 0, 0, &fw, sizeof(fw));
if (fw.revision[slot-1] != 0LLU)
if (fw.revision[slot-1][0] != '\0')
has_fw = true;
return (has_fw);