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
This commit is contained in:
John Baldwin 2024-03-15 08:18:47 -07:00
parent d2a824c29d
commit 1b38f851d8

View file

@ -104,7 +104,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);