git: 05a831511b78 - stable/14 - nvmecontrol: Update the test for a valid firmare revision slot
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 08 Apr 2024 19:04:42 UTC
The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=05a831511b787eba136c96dcd0985cacb18625f2 commit 05a831511b787eba136c96dcd0985cacb18625f2 Author: John Baldwin <jhb@FreeBSD.org> AuthorDate: 2024-03-15 15:18:47 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2024-04-08 18:01:30 +0000 nvmecontrol: Update the test for a valid firmare revision slot Reported by: Coverity Scan CID: 1539214 Fixes: 7485926e09a0 nvme: Firmware revisions in the firmware slot info logpage are ASCII strings (cherry picked from commit 1b38f851d809950cfe112c705029f40edd0579b3) --- sbin/nvmecontrol/firmware.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/nvmecontrol/firmware.c b/sbin/nvmecontrol/firmware.c index 256847ef8ac2..80bbff032cf2 100644 --- a/sbin/nvmecontrol/firmware.c +++ b/sbin/nvmecontrol/firmware.c @@ -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);