From patchwork Thu Apr 13 20:31:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 672840 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:184:0:0:0:0 with SMTP id p4csp1081434wrx; Thu, 13 Apr 2023 13:35:13 -0700 (PDT) X-Google-Smtp-Source: AKy350ZQChlVNa2woeAqwLNUpeVlsC1xZsFXyf7sBzCpru/AsTaPC1aWG9wiR63GEAVS8vwejvzh X-Received: by 2002:a05:6214:2624:b0:5e6:ceb5:7981 with SMTP id gv4-20020a056214262400b005e6ceb57981mr5668156qvb.51.1681418112849; Thu, 13 Apr 2023 13:35:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681418112; cv=none; d=google.com; s=arc-20160816; b=EdPTq0iekXaSaBDEMwD40TPLH1XPHXxxC/5GGdF7rCZkJ/8y8b2DNoa5i+nt5mQePg uTBaTMdVYLBpjnlaM3pslQtn+NIkXDR5rQtbWjRLJMCvSIoM5rFirNBi4N/uYSbsuRIA RpjfzSOS3YE3g19H2wYXP+8TlxWqNmoZ6iLptMsOobPptLn4gECjEYLs53uS47GTE/3Y DWXnMcJ0PMVqw76Y5SDiTN/AaeJUzf7GGbu1JsuvndYz34RrMy81oUw/UrYJX5fe65dz Nz+n02mXFLW/944kVEvU2vc0R6EDrql3SA3cC2ZJ+TYtm3+A+wLkQ6BQoMGVBlZ0LFvh tJyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=sxiOXNp8p4nD145rIAdAmBQMjZwxFTHqStYZkGZ4LsM=; b=nNjw2n5qABJojiiiiZMSV+j5Hqdq5ERejGXen1JvoBxR15DHA1Y5mbFM5vjnmby/ir KY6RCaz0wKetYOIUvYG5kLSdMXrpxvQ+q2ig/icKKF4yPdKynovJ2lgNCXh/w4uF900X Widyf1wX7BmAZqFbqn08xvJYQiSI7bgs8HKoqqZl9QWIPHZQH3RBrfVgncj/J8MVXSy4 9vN4yykSF05WU1dI8T+/rUcFPOdNdbuie//lbXdV4kA9SIQacs+jZ2Mp8yjJtYyJ9M4j XFY5ijP4POO3DUTxRU1QRvfdvHce6hqZQCDlFpUj24vTEdEU+xte/Zt7mAtKgVTENxv/ CjHw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id jm6-20020ad45ec6000000b00571a3b77862si1520963qvb.238.2023.04.13.13.35.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Apr 2023 13:35:12 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pn3cR-0003s0-JU; Thu, 13 Apr 2023 16:32:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pn3cP-0003qQ-ET; Thu, 13 Apr 2023 16:32:33 -0400 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pn3cF-0003kM-0T; Thu, 13 Apr 2023 16:32:33 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id EA00140139; Thu, 13 Apr 2023 23:31:56 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 6E24A95; Thu, 13 Apr 2023 23:31:55 +0300 (MSK) Received: (nullmailer pid 2344355 invoked by uid 1000); Thu, 13 Apr 2023 20:31:54 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Pierrick Bouvier , Konstantin Kostiuk , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Kostiantyn Kostiuk , Michael Tokarev Subject: [PATCH 12/21] qga/vss-win32: fix warning for clang++-15 Date: Thu, 13 Apr 2023 23:31:24 +0300 Message-Id: <20230413203143.2344250-12-mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230413203051.2344192-1-mjt@tls.msk.ru> References: <20230413203051.2344192-1-mjt@tls.msk.ru> MIME-Version: 1.0 Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Pierrick Bouvier Reported when compiling with clang-windows-arm64. ../qga/vss-win32/install.cpp:537:9: error: variable 'hr' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] if (!(ControlService(service, SERVICE_CONTROL_STOP, NULL))) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../qga/vss-win32/install.cpp:545:12: note: uninitialized use occurs here return hr; ^~ Signed-off-by: Pierrick Bouvier Fixes: 917ebcb170 ("qga-win: Fix QGA VSS Provider service stop failure") Reviewed-by: Konstantin Kostiuk Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Kostiantyn Kostiuk (cherry picked from commit 0fcd574b025fccdf14d5140687cafe2bc30b634f) Signed-off-by: Michael Tokarev --- qga/vss-win32/install.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qga/vss-win32/install.cpp b/qga/vss-win32/install.cpp index b57508fbe0..b8087e5baa 100644 --- a/qga/vss-win32/install.cpp +++ b/qga/vss-win32/install.cpp @@ -518,7 +518,7 @@ namespace _com_util /* Stop QGA VSS provider service using Winsvc API */ STDAPI StopService(void) { - HRESULT hr; + HRESULT hr = S_OK; SC_HANDLE manager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); SC_HANDLE service = NULL;