From nobody Mon Apr 8 20:26:00 2024 X-Original-To: dev-commits-src-branches@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 4VD0wT2ZWwz5Hhyv; Mon, 8 Apr 2024 20:26:01 +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 4VD0wT0fhhz3xpY; Mon, 8 Apr 2024 20:26:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607961; 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=HOUt+6jUFqH6IBGs5SZ3EJABXS+jRJzt3t3kQBABqGk=; b=UivEavaoYtMx0hwz02q8L55BSoGlqKmREjkDAAH4j9D+M2zAdKSKmgnxH9IQWMpWwWyY4S zX1q2sDN8qiSkFg7hIv7qoAYMSfQkaIm3Ipfj9iQqMtyHYOnGTOgnPaT5VvbgbKNQ9hkM9 jMrFMfz23e2pGBkX42EW0qeG5L+wb+xrZiDBMDrvO8gyCv2EAIks5gwGuYcDAjY/giMoCh 72Zyx1zCERClsV4A861DRPwsILt7VsC5DGbGgI4ueH5jNR8Uen1esng6TxLQDIw+stx3Xy g1VaIFrHtj3uOqik74eK1ADatJqYqy0mOIiFIOpZYJXGhuwWFVrcuUspFMVO7A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712607961; a=rsa-sha256; cv=none; b=MVZadQyr6wx2XLyiuEmAK3+XqRw1m2hPUPuhPUulZh4iS7Pis2tvD8kLOGg/M+PM8CHgv/ 2lIz5ptfujKeIlYxv4ad36M+fJamtow6/3j5vt/aGyCIclENN/yUul+0vuQD3dpBskh1GH AGeDemBuKrslvkfkr/yUBo2suGk0ye/p4DChJ8TRKCDwQ4H1yZdvXXIAtfeTYkGJl6tf9h CTzGyHGMPX1WFDmkFw88W/CX5Jm1/CLTbHK1eSpGtXthtOFgZJfDrE/zigW4rs2Ha33XTN MEfs4+quIbMRl3LcHPzaSntCW4znNEZt3DVCfcAEMmhNNhREf0cm01GCLZYcHQ== 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=1712607961; 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=HOUt+6jUFqH6IBGs5SZ3EJABXS+jRJzt3t3kQBABqGk=; b=AQWFN2Crp8+Upkawj9YD7zBcL6lazv3IE5pz3FMOYOgkrKP+D6bGPc6XA3Js1LGfg6Gl4L Qn0H27IYQM80XGJySViW18NcCQUFhYBRqD6IbGT27nfJy2Xv9uoA0mYoxQnEm9CQyRxZv/ 26xWBuqmIps/h9y6z91QND29iVD5Svl/4vPGA45MCn+5nJ1S/KGTXyVxWYuTNBhZeC/Vp2 cH7CAU34W7UQTBL9Vjny1iIdcQ/twoT6AmuNrrmF9YwiQ1sUK/Uils3jjxnsYb+uZVOeFi 60rhg28nCeF46eLonj4mftXPaXijsmvqcLQnoLq1BtqCUU7ed+G3XgYl557vHQ== 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 4VD0wT0GdVzQGT; Mon, 8 Apr 2024 20:26:01 +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 438KQ0xh040407; Mon, 8 Apr 2024 20:26:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438KQ0i2040404; Mon, 8 Apr 2024 20:26:00 GMT (envelope-from git) Date: Mon, 8 Apr 2024 20:26:00 GMT Message-Id: <202404082026.438KQ0i2040404@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 661e3d4f1548 - stable/13 - nvmecontrol: Update the test for a valid firmare revision slot List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 661e3d4f1548707358c3e1e51eeaf806b0a6f786 Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=661e3d4f1548707358c3e1e51eeaf806b0a6f786 commit 661e3d4f1548707358c3e1e51eeaf806b0a6f786 Author: John Baldwin AuthorDate: 2024-03-15 15:18:47 +0000 Commit: John Baldwin CommitDate: 2024-04-08 18:01:32 +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);