From nobody Fri Mar 15 15:26:58 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Tx7QW0VZlz5DcFw; Fri, 15 Mar 2024 15:26:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Tx7QV6d2mz4Z2s; Fri, 15 Mar 2024 15:26:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1710516418; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4XR+uVYoOhxrTK6DTiKl+e1iP3pU3fWcQdqUO0802n8=; b=iOkquUigAD5ovo877R4UglKVH5Y+wTXfRth34IDvCTx9yya2X8IIkM2W5l4ritKNMTzqU3 L0VhhYqtvYJrSNbOHiM1lq4u3OHocKbnrGMSOXs14hIC5eV2kgfYG5epYsFQ/5CBT76yXc Wub2hdk5ZZSnI0v6ySjdyTNjcZn5MsenQU4+2rfJEP2Mn3+LybbZ2ivJY/9kzAfzBCfySm qKoaRFklombWSPWwgQ0D595ZA2/KNRNUAxoGn3L9XRqbgAJKvOR47ULUX9+Lw7C8R4ckIk plpy8vhFBOGQjkkoJsnUNzYkR/ph8oQE+tTovMkYlCUzn2zfl/238917VkreBg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1710516418; a=rsa-sha256; cv=none; b=SyrFVW9Xgta/wRK7rFyTyY47Ne0YqvG+J0LC5ve+BffJLVRgQDInHMQJvV5W2LOosBAW5o twL17C3A0T/sW1irKXFPDN93j3uuecjRpF4AFrCOd7/C3wNPFssVnOYFdej5+y4KU8mI5o +wLRneLEYfY1YzuMalr8/pDgRAqJzHBYTLVdGGXDRbuQvXo2LNM3ahW/mRn+BZl84HVXz2 Z11dWnAXByuVn5HafJotIxEIQWDUlARr5YUOfI9Mpsgnpx+SfuQCRe61pMgj4SBg4DV2KS o/Xz/ZFWGMujP2svw3fPBZBuody2AEi0xFhss0MP32tvg9HKZBWeW4z47sL6Lg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1710516418; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4XR+uVYoOhxrTK6DTiKl+e1iP3pU3fWcQdqUO0802n8=; b=Y9qNKCt/+nGOLAkZNPcRa31t/J/SfL/wJFKZnxRsc8F9eTvfJmEQrQV87kG2+5fem2P8el JD93/N8UlrT+s6kiUYbm+bYEqlP3lkxXnWcbwuE0fEVygklxNR7Hq2nw1ks4TNqLY/17Hw i24dXHKFGooVCC/ofRSUsfpVyYIIIOiyY7jDSdcKanob7SfbNQ+3/TrCeLXEPPV6g12CdW ZJ5tSOzKIhD1eucKikayTF8pf+9X4KnWAxHPC0xzpvBTUt8XELdZEjEAEb7hHpctuMz1ms Aj19UBKDTfpeicQ1ZTg60VnVwIL0KLi4xBWYWEF5JZJKLen5Ze1N0h9wDPfUDg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Tx7QV664FzGvM; Fri, 15 Mar 2024 15:26:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 42FFQw5H047701; Fri, 15 Mar 2024 15:26:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42FFQwmJ047698; Fri, 15 Mar 2024 15:26:58 GMT (envelope-from git) Date: Fri, 15 Mar 2024 15:26:58 GMT Message-Id: <202403151526.42FFQwmJ047698@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 1b38f851d809 - main - nvmecontrol: Update the test for a valid firmare revision slot List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1b38f851d809950cfe112c705029f40edd0579b3 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=1b38f851d809950cfe112c705029f40edd0579b3 commit 1b38f851d809950cfe112c705029f40edd0579b3 Author: John Baldwin AuthorDate: 2024-03-15 15:18:47 +0000 Commit: John Baldwin CommitDate: 2024-03-15 15:18:47 +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 --- 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 9e60bd0cee37..9ce2daf28d65 100644 --- a/sbin/nvmecontrol/firmware.c +++ b/sbin/nvmecontrol/firmware.c @@ -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);