From nobody Thu Feb 16 02:23:07 2023 X-Original-To: dev-commits-src-main@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 4PHJdR4FGkz3rvyl; Thu, 16 Feb 2023 02:23:07 +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 4PHJdR2Jgyz4H0R; Thu, 16 Feb 2023 02:23:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676514187; 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=1Zn4U+gj2df5y8wE1Ok93E85+rilgIJh+sfT9w8PEVM=; b=Cgu/7z+TILvlELvRMkJu87rNzPCKGZSMC3rUEVrwDTbwsiJLjlze/KonXkgfVVUiRPCW8W vV8Pi6CbCjvzQic7zNRonXckm+SJnkFh62wvG31hE6JIKIjFHCczvvS5bddRiotIocdQLc pFjjsCf7QpUhOED1Xq4dhV6vBOwF0QM4jO0efl+LC7Jq5YPQsfauSi+1lVxuiXXv+QRH2T 7aBZ4VHb7wpbMwzoHKglbo0gW+OdA719e+5w05NFdsaNT3VrhzDCUT/lOLAR7OzIh9ZfMW jO2hZmBsH5x6CCx6orKX6R5GrhCGeuU+P4XdMHIs8aZT0EIdX3w2oGNUrNm7Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676514187; 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=1Zn4U+gj2df5y8wE1Ok93E85+rilgIJh+sfT9w8PEVM=; b=CWOxPqjFHU4CPE+ZvNhHVeeo5aX+M1LuNzH2QPhlpntmqzG6pqNkKy1ogcN/ca+hQnJ6QG VWdgy//fhyOFXOvVdj3sVUaqwCmfwQwSA/aRaADrb7dwMsjny8iHtJ3C0YdSY5qd+A7sjn /UkQhEq/16vHOB5LDD9stMibIyB5pCIHVGKh6pA2C9uTaeUBc6I4EXRFh6PkauXcFvvP/d n9ddLgmPfONDMWmB/gjxnc+vfrb545FcQsJW9e5xRyWKvrWvAOC0kQ04hmSlxHBfaPecDF d2UGCj25e5i7xyYwGv1hfDJ/WZYp+aXVC7RrtYUBxMbl7GPo726OY8zEaGYG1Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676514187; a=rsa-sha256; cv=none; b=FnQbnSUmPCWFf+wTieH0GUaflS27S1qDoQPAuDQdFVZtqmGviC6QXgRO1xVUbK3FbeDzqQ +I9yyCPPJWsfRLd6m63lZc7Xc8Y9X0v/wW/diTb4IK73WAEIbuzSTWc/xk9dThB62KitbG jWAEwUrYVHaL9jBA+0sJZx6FxVotXpggHZ75lJrT9do5EqYu1oaPW5u4oJ3PI0632DKICt VuCIa/wpRTJx1iuYReCegKFYdA/Mgs5CurF7UA91wXPaLgh4+l3nZedU2vVJiJAt8OKDqH y+De7+JmoTUC0eMBCF0dSgY4meFPY2xj5g6TgGhrDg+zj4baH6iMPsxPMBc4qQ== 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 4PHJdR1NWcznJD; Thu, 16 Feb 2023 02:23:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31G2N7Lr042527; Thu, 16 Feb 2023 02:23:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31G2N7Wl042526; Thu, 16 Feb 2023 02:23:07 GMT (envelope-from git) Date: Thu, 16 Feb 2023 02:23:07 GMT Message-Id: <202302160223.31G2N7Wl042526@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: David Bright Subject: git: b086426bc210 - main - hyperv: Fix Coverity issues in the Hyper-V driver List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dab X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b086426bc210ea567422b7bedaa637f345ad2d7d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dab: URL: https://cgit.FreeBSD.org/src/commit/?id=b086426bc210ea567422b7bedaa637f345ad2d7d commit b086426bc210ea567422b7bedaa637f345ad2d7d Author: Robert Herndon AuthorDate: 2023-02-12 05:09:20 +0000 Commit: David Bright CommitDate: 2023-02-16 00:24:45 +0000 hyperv: Fix Coverity issues in the Hyper-V driver Summary: Coverity reports the use of two uninitialized variables in the hyperv driver. Examination shows the variables can be accessed while uninitialized in error cases. Fix both. CID: 1365235 CID: 1365236 Sponsored by: Dell Technologies MFC after: 1w Test Plan: Changes in use at $WORK Reviewers: robert.herndon_dell.com, vangyzen, bret_ketchum_dell.com Subscribers: imp, badger Differential Revision: https://reviews.freebsd.org/D38551 --- sys/dev/hyperv/utilities/vmbus_ic.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/dev/hyperv/utilities/vmbus_ic.c b/sys/dev/hyperv/utilities/vmbus_ic.c index 574670053918..f21a0242a44d 100644 --- a/sys/dev/hyperv/utilities/vmbus_ic.c +++ b/sys/dev/hyperv/utilities/vmbus_ic.c @@ -59,6 +59,9 @@ vmbus_ic_negomsg(struct vmbus_ic_softc *sc, void *data, int *dlen0, uint32_t sel_fw_ver, sel_msg_ver; bool has_fw_ver, has_msg_ver; + has_fw_ver = false; + has_msg_ver = false; + /* * Preliminary message verification. */ @@ -92,7 +95,6 @@ vmbus_ic_negomsg(struct vmbus_ic_softc *sc, void *data, int *dlen0, /* * Find the best match framework version. */ - has_fw_ver = false; for (i = 0; i < nego->ic_fwver_cnt; ++i) { if (VMBUS_ICVER_LE(nego->ic_ver[i], fw_ver)) { if (!has_fw_ver) { @@ -111,9 +113,8 @@ vmbus_ic_negomsg(struct vmbus_ic_softc *sc, void *data, int *dlen0, } /* - * Fine the best match message version. + * Find the best match message version. */ - has_msg_ver = false; for (i = nego->ic_fwver_cnt; i < nego->ic_fwver_cnt + nego->ic_msgver_cnt; ++i) { if (VMBUS_ICVER_LE(nego->ic_ver[i], msg_ver)) {