From nobody Wed May 22 00:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1711621313; cv=none; d=zohomail.com; s=zohoarc; b=dPbuXwfwUiSpXJhq2/UvvdXNAqgacYRijnJ9pZ8toEudkSXjNOK7wvMgs2LOWgs95j05Z8q7BqEK6O6jmzspLGX8/kZN3hA/sU1a46vLhQm14NMV24yI7IGTjsxxLwXVj0CcoTcjOc0m3to8Opm1ESgYT42iTvo9WqIgvZxT17U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711621313; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=KaTYed9JbKbDUOzCmrNKFs9q/ptXCkoB2hyDBvj3iIk=; b=McSAn4OeN19ppA8xb3+3ntJsDbqvPrWwAfFxS/7KfSIv8la0ETmgHB2BD/q88O+V/bzNWKeyaBdtrGyD3nNCjAyzExQSGdoJN/DA5K4t8mIrulBc3PAGgt+puJT/EAA//KSVwKJ+O6Q3JfECpbWYcAW+nryXo8punvBcxHDJwoM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1711621313147388.96037709285235; Thu, 28 Mar 2024 03:21:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpmsr-0001C5-J5; Thu, 28 Mar 2024 06:21:21 -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 1rpmsp-0001Bi-OF for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:21:19 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rpmso-0007dR-F4 for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:21:19 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-117-r5ueP5g9PAucweE_MeRArA-1; Thu, 28 Mar 2024 06:21:11 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8E395803FC7; Thu, 28 Mar 2024 10:21:10 +0000 (UTC) Received: from localhost (unknown [10.39.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8A4A317AA3; Thu, 28 Mar 2024 10:21:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711621277; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KaTYed9JbKbDUOzCmrNKFs9q/ptXCkoB2hyDBvj3iIk=; b=RNmgj26/74hRTnN6PMIyzyEBLgJD4SjwQL3Hg35cF0JzSJOPLxUmOYcnRht8NIL5xrSfAX XrK2qOfXwjMMlVtFf/sKaQppCg0PJg56EWbwSM8DWccNtBMJsUs7nU0y+KsMqdTU45HlWy fSunecRea6eGejY5qtkDThHuh/3gBkY= X-MC-Unique: r5ueP5g9PAucweE_MeRArA-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Hyman Huang , Vladimir Sementsov-Ogievskiy , Paolo Bonzini , Gerd Hoffmann , qemu-block@nongnu.org, Kevin Wolf , Fabiano Rosas , Mahmoud Mandour , John Snow , Klaus Jensen , Fam Zheng , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Bin Meng , Hanna Reitz , Eric Blake , "Michael S. Tsirkin" , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yuval Shaia , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Jesper Devantier , Pierrick Bouvier , Keith Busch , Marcel Apfelbaum , Alexandre Iooss , Peter Xu , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 01/19] util/coroutine: fix -Werror=maybe-uninitialized false-positive Date: Thu, 28 Mar 2024 14:20:34 +0400 Message-ID: <20240328102052.3499331-2-marcandre.lureau@redhat.com> In-Reply-To: <20240328102052.3499331-1-marcandre.lureau@redhat.com> References: <20240328102052.3499331-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1711621314723100003 From: Marc-Andr=C3=A9 Lureau ../util/qemu-coroutine.c:150:8: error: =E2=80=98batch=E2=80=99 may be used = uninitialized [-Werror=3Dmaybe-uninitialized] Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Stefan Hajnoczi --- util/qemu-coroutine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/qemu-coroutine.c b/util/qemu-coroutine.c index eb4eebefdf..64d6264fc7 100644 --- a/util/qemu-coroutine.c +++ b/util/qemu-coroutine.c @@ -136,7 +136,7 @@ static Coroutine *coroutine_pool_get_local(void) static void coroutine_pool_refill_local(void) { CoroutinePool *local_pool =3D get_ptr_local_pool(); - CoroutinePoolBatch *batch; + CoroutinePoolBatch *batch =3D NULL; =20 WITH_QEMU_LOCK_GUARD(&global_pool_lock) { batch =3D QSLIST_FIRST(&global_pool); --=20 2.44.0 From nobody Wed May 22 00:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1711621309; cv=none; d=zohomail.com; s=zohoarc; b=T9XKhX2eWaKnNGv9yTw3ERWFfY8skdSrEtoipay+JE1wwPL6w4uUKbQgea9F/dIF/SsEPKBR2md8J3uAbEZnYlZ8M7mR64nVsndxy2kJeKuFsF9qYE3FecNsn659a/OtRc8H4hLB1kc0dxB7LQqrZyk/qwM88mymI9+hkb/10YE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711621309; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=y3wvKkniOci8N/E6JK6BGXDPTZsW6UL+VmwHgyGsXKs=; b=Ox/fNlUcjbdZHJOH3s6lYE/BqR/N577U5k8BoSb/SSxcsbxGn8+fYIgvICJZ1kkt71fEYl8o4SQN9VsCjvJQ+F2HmSyEX8wTe5yRRGI8OeRMBg6yFcJZm35PCVKDSZWRLpAvOvWfZtO4CAU1TgCUWQycoaqm0cHHqiaeFGxaDGo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1711621309241892.1918919624106; Thu, 28 Mar 2024 03:21:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpmsz-0001Dp-W7; Thu, 28 Mar 2024 06:21:30 -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 1rpmsy-0001Df-42 for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:21:28 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rpmsw-0007f8-NY for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:21:27 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-548-d3SQsnc4O-6PzZrNmZvk3g-1; Thu, 28 Mar 2024 06:21:20 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6D8A63815EFA; Thu, 28 Mar 2024 10:21:19 +0000 (UTC) Received: from localhost (unknown [10.39.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8DD2917AA0; Thu, 28 Mar 2024 10:21:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711621286; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=y3wvKkniOci8N/E6JK6BGXDPTZsW6UL+VmwHgyGsXKs=; b=axyt6EsK8bS+bm05yeeeexHEJbuVEcPU8z2IKHFYtog+xpziWN0YjYdciEpe6u29nh7yPV aEwq4k+rr6vssQk/08YKjXlhu+gb+pKIgxONfnrxCvhSlTjk0/ToCwbaHRL+Usy2MVcImb NHPo+tb67JICD7eQ0V81bQBXpVG+3/k= X-MC-Unique: d3SQsnc4O-6PzZrNmZvk3g-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Hyman Huang , Vladimir Sementsov-Ogievskiy , Paolo Bonzini , Gerd Hoffmann , qemu-block@nongnu.org, Kevin Wolf , Fabiano Rosas , Mahmoud Mandour , John Snow , Klaus Jensen , Fam Zheng , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Bin Meng , Hanna Reitz , Eric Blake , "Michael S. Tsirkin" , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yuval Shaia , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Jesper Devantier , Pierrick Bouvier , Keith Busch , Marcel Apfelbaum , Alexandre Iooss , Peter Xu , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 02/19] util/timer: with -Werror=maybe-uninitialized false-positive Date: Thu, 28 Mar 2024 14:20:35 +0400 Message-ID: <20240328102052.3499331-3-marcandre.lureau@redhat.com> In-Reply-To: <20240328102052.3499331-1-marcandre.lureau@redhat.com> References: <20240328102052.3499331-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1711621310895100003 From: Marc-Andr=C3=A9 Lureau ../util/qemu-timer.c:198:24: error: =E2=80=98expire_time=E2=80=99 may be us= ed uninitialized [-Werror=3Dmaybe-uninitialized] ../util/qemu-timer.c:476:8: error: =E2=80=98rearm=E2=80=99 may be used unin= itialized [-Werror=3Dmaybe-uninitialized] Signed-off-by: Marc-Andr=C3=A9 Lureau --- util/qemu-timer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/util/qemu-timer.c b/util/qemu-timer.c index 6a0de33dd2..12b22cf69b 100644 --- a/util/qemu-timer.c +++ b/util/qemu-timer.c @@ -182,7 +182,7 @@ bool qemu_clock_has_timers(QEMUClockType type) =20 bool timerlist_expired(QEMUTimerList *timer_list) { - int64_t expire_time; + int64_t expire_time =3D 0; =20 if (!qatomic_read(&timer_list->active_timers)) { return false; @@ -212,7 +212,7 @@ bool qemu_clock_expired(QEMUClockType type) int64_t timerlist_deadline_ns(QEMUTimerList *timer_list) { int64_t delta; - int64_t expire_time; + int64_t expire_time =3D 0; =20 if (!qatomic_read(&timer_list->active_timers)) { return -1; @@ -461,7 +461,7 @@ void timer_mod_ns(QEMUTimer *ts, int64_t expire_time) void timer_mod_anticipate_ns(QEMUTimer *ts, int64_t expire_time) { QEMUTimerList *timer_list =3D ts->timer_list; - bool rearm; + bool rearm =3D false; =20 WITH_QEMU_LOCK_GUARD(&timer_list->active_timers_lock) { if (ts->expire_time =3D=3D -1 || ts->expire_time > expire_time) { --=20 2.44.0 From nobody Wed May 22 00:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1711621340; cv=none; d=zohomail.com; s=zohoarc; b=a4n/f8McljxvKNbdwHt/r+gzZnpX9XhNBaUs2FYX70QjvdaR0sfG+P0jxvqdllsBmZwT1bga+TNCvAbIKyxVp0LqW5jdVn6HBe/lqkVkTIv9XAZ+RvPPLyikwdYIwF/SdKh/rkgqW2IyCD1Yz1JLD0HDNRQKOjEywdDlN3PT2io= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711621340; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=y/vamgEPesv1LH1WTnyWl39ppKFCa3bicitEsVUYD2Q=; b=ZKOwziPfhJtKUQ78FetmBgiqdp7lQa3V2zEK1Al0dQ9xKemO403v67Rvb+ObHOt9iVYdXSmLZr8gHfm7yfxMJl3hasBRBkFzDTo3qBUI5N0K4PwSoeChmXefwNomJYKNYzeLF9L0u5MQ3vS420ezd69yhVBiu9cVsVMjaBejMtU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1711621340688638.3183348900901; Thu, 28 Mar 2024 03:22:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpmtH-0001JO-Pc; Thu, 28 Mar 2024 06:21:48 -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 1rpmtF-0001Ix-9f for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:21:45 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rpmtD-0007gQ-Re for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:21:45 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-280-yrvhd50lN6SNEghHVn2bjw-1; Thu, 28 Mar 2024 06:21:39 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 520548007A2; Thu, 28 Mar 2024 10:21:38 +0000 (UTC) Received: from localhost (unknown [10.39.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 780673C20; Thu, 28 Mar 2024 10:21:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711621303; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=y/vamgEPesv1LH1WTnyWl39ppKFCa3bicitEsVUYD2Q=; b=SvdrphbEb0ZykrUf9DW62ioNvPiFpL14EoA6cBs58ycNYbNPeAxvB+xm8qqnvVrT6YzqeO 1JVE4P4DVTImav7przaV5ihucUbYoB/FdM6Pgtfqx5KbYFBPUWNWp5p6my/tAbY3gcmTTe 6F0cPdcNOLsKQV0MBbsWndOiQF2Qev4= X-MC-Unique: yrvhd50lN6SNEghHVn2bjw-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Hyman Huang , Vladimir Sementsov-Ogievskiy , Paolo Bonzini , Gerd Hoffmann , qemu-block@nongnu.org, Kevin Wolf , Fabiano Rosas , Mahmoud Mandour , John Snow , Klaus Jensen , Fam Zheng , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Bin Meng , Hanna Reitz , Eric Blake , "Michael S. Tsirkin" , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yuval Shaia , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Jesper Devantier , Pierrick Bouvier , Keith Busch , Marcel Apfelbaum , Alexandre Iooss , Peter Xu , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 03/19] hw/qxl: fix -Werror=maybe-uninitialized false-positives Date: Thu, 28 Mar 2024 14:20:36 +0400 Message-ID: <20240328102052.3499331-4-marcandre.lureau@redhat.com> In-Reply-To: <20240328102052.3499331-1-marcandre.lureau@redhat.com> References: <20240328102052.3499331-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1711621342840100005 From: Marc-Andr=C3=A9 Lureau ../hw/display/qxl.c:1352:5: error: =E2=80=98pci_region=E2=80=99 may be used= uninitialized [-Werror=3Dmaybe-uninitialized] ../hw/display/qxl.c:1365:22: error: =E2=80=98pci_start=E2=80=99 may be used= uninitialized [-Werror=3Dmaybe-uninitialized] Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/display/qxl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/display/qxl.c b/hw/display/qxl.c index 7178dec85d..cfea4e7af5 100644 --- a/hw/display/qxl.c +++ b/hw/display/qxl.c @@ -1301,8 +1301,8 @@ static int qxl_add_memslot(PCIQXLDevice *d, uint32_t = slot_id, uint64_t delta, }; uint64_t guest_start; uint64_t guest_end; - int pci_region; - pcibus_t pci_start; + int pci_region =3D -1; + pcibus_t pci_start =3D -1; pcibus_t pci_end; MemoryRegion *mr; intptr_t virt_start; --=20 2.44.0 From nobody Wed May 22 00:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1711621348; cv=none; d=zohomail.com; s=zohoarc; b=YQGsxd7r06ZRtafneXY29UWRDF8V4R9iaOdKr4W1ebqKYKRVmubIawoPTZ7MWkGbKoC9d76mJkR8YdEsjndmSFBFJGSpEZGigDhz1XM2NLuRh9WBzIYgEGQS8uv3VqvKxM5+hOsKGrHx645y1+Dw3xnVB9PCrGTqyHkNe3omVbY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711621348; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=EZXGqjezLQknOl9DTqO4g0fNDh8PejkqsUV/dtx7G1Q=; b=b4sym3fRhuY1q2qvzhgJyfqFseb4tWGIpdz27Toc/hMQIiG6DUmUPEOUFh4p3D957WoBIF5ib+o9sa3Pendl5V3sfU4nttOUjqp+pT3Vvm5JD0gGr5cWiWrnTb8Rw1Bh1dyxHiK3RXpkXIQlWvk5sfdKBe59IHE37vaxzhQvB/I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1711621348225943.60865785046; Thu, 28 Mar 2024 03:22:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpmti-0001t2-Bj; Thu, 28 Mar 2024 06:22:15 -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 1rpmtP-0001Ze-Ij for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:22:01 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rpmtO-0007iK-53 for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:21:55 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-94-mQehkmTNPGKvR92PlfN4jA-1; Thu, 28 Mar 2024 06:21:48 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 631FB1C04198; Thu, 28 Mar 2024 10:21:47 +0000 (UTC) Received: from localhost (unknown [10.39.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5DB7D492BC8; Thu, 28 Mar 2024 10:21:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711621313; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EZXGqjezLQknOl9DTqO4g0fNDh8PejkqsUV/dtx7G1Q=; b=Dh9yl7TbG7Ps64ZXXEP6ikYESBoIthtiU6nxevOSa2lCvMCZfrmMv0qHRFZ7qVA1e5oSLq mfA8Bc+zjBi+aDHoRYyfInCMv/nJe/J7I5dDuNctekUmsSx6HiVkgoKrEX9sPJLzCZPQev uWv4vGp+HYKD9GeK8Zk0aDmP9ZMevX0= X-MC-Unique: mQehkmTNPGKvR92PlfN4jA-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Hyman Huang , Vladimir Sementsov-Ogievskiy , Paolo Bonzini , Gerd Hoffmann , qemu-block@nongnu.org, Kevin Wolf , Fabiano Rosas , Mahmoud Mandour , John Snow , Klaus Jensen , Fam Zheng , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Bin Meng , Hanna Reitz , Eric Blake , "Michael S. Tsirkin" , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yuval Shaia , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Jesper Devantier , Pierrick Bouvier , Keith Busch , Marcel Apfelbaum , Alexandre Iooss , Peter Xu , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 04/19] nbd: with -Werror=maybe-uninitialized false-positive Date: Thu, 28 Mar 2024 14:20:37 +0400 Message-ID: <20240328102052.3499331-5-marcandre.lureau@redhat.com> In-Reply-To: <20240328102052.3499331-1-marcandre.lureau@redhat.com> References: <20240328102052.3499331-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1711621348650100001 From: Marc-Andr=C3=A9 Lureau ../nbd/client-connection.c:419:8: error: =E2=80=98wait_co=E2=80=99 may be u= sed uninitialized [-Werror=3Dmaybe-uninitialized] Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Eric Blake --- nbd/client-connection.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nbd/client-connection.c b/nbd/client-connection.c index f9da67c87e..b11e266807 100644 --- a/nbd/client-connection.c +++ b/nbd/client-connection.c @@ -410,7 +410,7 @@ nbd_co_establish_connection(NBDClientConnection *conn, = NBDExportInfo *info, */ void nbd_co_establish_connection_cancel(NBDClientConnection *conn) { - Coroutine *wait_co; + Coroutine *wait_co =3D NULL; =20 WITH_QEMU_LOCK_GUARD(&conn->mutex) { wait_co =3D g_steal_pointer(&conn->wait_co); --=20 2.44.0 From nobody Wed May 22 00:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1711621363; cv=none; d=zohomail.com; s=zohoarc; b=YSvV+h7Kp6+m/+6ZWJBkOJD0a73YPB388m8AMZhL3T4LFQJIq0vxzZbnM07A5lFwul6zA08aYVR5wPP3gByxmsxKPjN47Zv7i45eDlE84lWoIMky6W+4amJWie5CJuc7a/Y0AKYjLQ9FNutT/kiav/VyVIYsp13JspVo/AXspbc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711621363; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=0O2oh/ewqObmBKDUNq/tce2cGYYv3eGMGKiYbvHD3Ow=; b=KKMAP4xdUzIpP2sQX9QFslR/v3m4pVvlKSplOT/z4wJAZJRHov+astQ8lisV5KF5ArJHEoullEyYDJaE2oRNqMBR0ctBb422WNMH1CZJ29NMJjEppZj/2/Ltk2gGDqjBa9X1w4UFDqT96hPYUbLOlryxgMOLB4wRD8m5LI/k2fs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1711621363406399.82850139415154; Thu, 28 Mar 2024 03:22:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpmtr-0002Le-51; Thu, 28 Mar 2024 06:22:23 -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 1rpmta-0001mk-Az for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:22:06 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rpmtW-0007it-Gb for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:22:03 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-515-OEHL0HFaOmGOFXBfmS-8RQ-1; Thu, 28 Mar 2024 06:21:57 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 108091C0650B; Thu, 28 Mar 2024 10:21:56 +0000 (UTC) Received: from localhost (unknown [10.39.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2E8FD492BD7; Thu, 28 Mar 2024 10:21:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711621321; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0O2oh/ewqObmBKDUNq/tce2cGYYv3eGMGKiYbvHD3Ow=; b=UR9y6L8XD//XUSKPgACZLyH60EK5CalH5uOEYD33MevfZ7x1EXjML8PbL9LRXiwI8OKyfe zmfXqdvIVZYpMwRAkKRWgwi267Smx9ZhJKjcjjoASQpL0L+l6mbSWNngB5tbSnf5XScdib lUg9fad7Il9ANXCFOvdlO6awAERwld8= X-MC-Unique: OEHL0HFaOmGOFXBfmS-8RQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Hyman Huang , Vladimir Sementsov-Ogievskiy , Paolo Bonzini , Gerd Hoffmann , qemu-block@nongnu.org, Kevin Wolf , Fabiano Rosas , Mahmoud Mandour , John Snow , Klaus Jensen , Fam Zheng , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Bin Meng , Hanna Reitz , Eric Blake , "Michael S. Tsirkin" , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yuval Shaia , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Jesper Devantier , Pierrick Bouvier , Keith Busch , Marcel Apfelbaum , Alexandre Iooss , Peter Xu , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 05/19] block/mirror: fix -Werror=maybe-uninitialized false-positive Date: Thu, 28 Mar 2024 14:20:38 +0400 Message-ID: <20240328102052.3499331-6-marcandre.lureau@redhat.com> In-Reply-To: <20240328102052.3499331-1-marcandre.lureau@redhat.com> References: <20240328102052.3499331-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1711621364688100005 From: Marc-Andr=C3=A9 Lureau ../block/mirror.c:1066:22: error: =E2=80=98iostatus=E2=80=99 may be used un= initialized [-Werror=3Dmaybe-uninitialized] Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Vladimir Sementsov-Ogievskiy --- block/mirror.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/mirror.c b/block/mirror.c index 1bdce3b657..53dd7332ee 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -926,7 +926,7 @@ static int coroutine_fn mirror_run(Job *job, Error **er= rp) MirrorBDSOpaque *mirror_top_opaque =3D s->mirror_top_bs->opaque; BlockDriverState *target_bs =3D blk_bs(s->target); bool need_drain =3D true; - BlockDeviceIoStatus iostatus; + BlockDeviceIoStatus iostatus =3D BLOCK_DEVICE_IO_STATUS__MAX; int64_t length; int64_t target_length; BlockDriverInfo bdi; --=20 2.44.0 From nobody Wed May 22 00:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1711621366; cv=none; d=zohomail.com; s=zohoarc; b=auviJHslDLXQpFLFatrmGamu2+m/h6KAAChK4e+LqsxsDU17xFcJt8e4yKwjFFFWXalGBjrkkOwDzS0w1HKmcZ51vQqGbn7ypYzTiRhpeLf9LQP8Jne9sLnomNRAl28EGrkmOyDnhUkBd1NmnejCQ6sRue5rR0b3E9gMa1sn5Yg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711621366; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=GrnGE29PSFeL3UMwDPbWkEIoIwZ6RbhGysI0U5zHMB4=; b=kMborCptQdM5Um17Ai9Y/YL3iVd3b9B34+2PMiLXxwbZWlyeBoFMEsPfuvU42NUoPXZHpUwCvzPA9aLoM9L7Y8Zv5k5gexm+ksrXW2OHsmBo85jM0+m717siElUGAu4e6TpZcMlkBmPUXq7DZx9RYvKyiYY+DG9E7WqsDzcPSOc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17116213668883.4329298873462903; Thu, 28 Mar 2024 03:22:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpmtt-0002ak-7o; Thu, 28 Mar 2024 06:22:25 -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 1rpmtg-0001tv-9c for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:22:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rpmte-0007jn-IZ for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:22:11 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-240-LuFJJhqGP4uod3fv4SWGcQ-1; Thu, 28 Mar 2024 06:22:06 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 33945803FC4; Thu, 28 Mar 2024 10:22:05 +0000 (UTC) Received: from localhost (unknown [10.39.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 44679492BD0; Thu, 28 Mar 2024 10:22:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711621330; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GrnGE29PSFeL3UMwDPbWkEIoIwZ6RbhGysI0U5zHMB4=; b=HRgxVIBy0d6zQ1nDZHyTKAM/yel5Sqbb8TJ6naNaKB93iYMklvetEdBi4ZslJa+vYgWcs0 upQMoPBMHkqd/mIEJy6rNNmpKYfDW/ifW8+YbTYG6CpY+ONcO3VpbaKzcPsnQZhQQNSMBp faDqDNNt7ARQGjg+hzHTfLJZbG7dh8o= X-MC-Unique: LuFJJhqGP4uod3fv4SWGcQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Hyman Huang , Vladimir Sementsov-Ogievskiy , Paolo Bonzini , Gerd Hoffmann , qemu-block@nongnu.org, Kevin Wolf , Fabiano Rosas , Mahmoud Mandour , John Snow , Klaus Jensen , Fam Zheng , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Bin Meng , Hanna Reitz , Eric Blake , "Michael S. Tsirkin" , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yuval Shaia , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Jesper Devantier , Pierrick Bouvier , Keith Busch , Marcel Apfelbaum , Alexandre Iooss , Peter Xu , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 06/19] block/stream: fix -Werror=maybe-uninitialized false-positives Date: Thu, 28 Mar 2024 14:20:39 +0400 Message-ID: <20240328102052.3499331-7-marcandre.lureau@redhat.com> In-Reply-To: <20240328102052.3499331-1-marcandre.lureau@redhat.com> References: <20240328102052.3499331-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1711621368714100006 From: Marc-Andr=C3=A9 Lureau ../block/stream.c:193:19: error: =E2=80=98unfiltered_bs=E2=80=99 may be use= d uninitialized [-Werror=3Dmaybe-uninitialized] ../block/stream.c:176:5: error: =E2=80=98len=E2=80=99 may be used uninitial= ized [-Werror=3Dmaybe-uninitialized] trace/trace-block.h:906:9: error: =E2=80=98ret=E2=80=99 may be used uniniti= alized [-Werror=3Dmaybe-uninitialized] Signed-off-by: Marc-Andr=C3=A9 Lureau Acked-by: Vladimir Sementsov-Ogievskiy --- block/stream.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/block/stream.c b/block/stream.c index 7031eef12b..9076203193 100644 --- a/block/stream.c +++ b/block/stream.c @@ -155,8 +155,8 @@ static void stream_clean(Job *job) static int coroutine_fn stream_run(Job *job, Error **errp) { StreamBlockJob *s =3D container_of(job, StreamBlockJob, common.job); - BlockDriverState *unfiltered_bs; - int64_t len; + BlockDriverState *unfiltered_bs =3D NULL; + int64_t len =3D -1; int64_t offset =3D 0; int error =3D 0; int64_t n =3D 0; /* bytes */ @@ -177,7 +177,7 @@ static int coroutine_fn stream_run(Job *job, Error **er= rp) =20 for ( ; offset < len; offset +=3D n) { bool copy; - int ret; + int ret =3D -1; =20 /* Note that even when no rate limit is applied we need to yield * with no pending I/O here so that bdrv_drain_all() returns. --=20 2.44.0 From nobody Wed May 22 00:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1711621376; cv=none; d=zohomail.com; s=zohoarc; b=eXpteCe+XHhfU2qwgmPNbPaujC00RrVECUMDUaBhvQwQOMOXzOl/AAQhyMR7o+wWaf25K083+VVLUcTXm9jLcgl3LgxIInYp23QruAcZ78GfdWaWgN8FdllbYSOerOZcgf+OW0dpXq0ZpXW0ECcV9QiLisCxA+xsvyaEO/bWQaw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711621376; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=NEwfK/eU2wdu5EsnKOCQRIJRHejP9jR1iKVyrMXHyPU=; b=PSAB8dYCdHqEKzOYwj52TZHWoUJH0mBtPo78xFyYCesljGfq9Dh46kGIS9c7epFQPpUd0WWlHyVmz8c96CkcOtNdyntU5kxsnUjP/xZdVPj8ny7hUGFkA7Ruq7M+0o3sCbVrxfK4ydy+xxDExTYuDBlVgllO+P1OLyykBvDOhDY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1711621376622721.381219588496; Thu, 28 Mar 2024 03:22:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpmts-0002QJ-5p; Thu, 28 Mar 2024 06:22:24 -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 1rpmtn-0002Au-Tn for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:22:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rpmtm-0007kO-EF for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:22:19 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-161-2s2_XBCYOteh0JSfVJA0DQ-1; Thu, 28 Mar 2024 06:22:14 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id ECFF629AC032; Thu, 28 Mar 2024 10:22:13 +0000 (UTC) Received: from localhost (unknown [10.39.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id E948E1C060D0; Thu, 28 Mar 2024 10:22:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711621337; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NEwfK/eU2wdu5EsnKOCQRIJRHejP9jR1iKVyrMXHyPU=; b=cewjBGf+KUrCigKni0FwznxM5CWN+5t1XaJaL8W5DhfpiBPPfStAy7TW/pC9F6ecNPrZJU T67GKgzcu7c4PrhxdG0vjAdOte1xgsXHfbAOtcASL5ZVAEZrKQrqomwE1MklducnQMR8B4 TrQTxPb0GXTgvV87S5Hqnq9oLe1jFWA= X-MC-Unique: 2s2_XBCYOteh0JSfVJA0DQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Hyman Huang , Vladimir Sementsov-Ogievskiy , Paolo Bonzini , Gerd Hoffmann , qemu-block@nongnu.org, Kevin Wolf , Fabiano Rosas , Mahmoud Mandour , John Snow , Klaus Jensen , Fam Zheng , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Bin Meng , Hanna Reitz , Eric Blake , "Michael S. Tsirkin" , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yuval Shaia , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Jesper Devantier , Pierrick Bouvier , Keith Busch , Marcel Apfelbaum , Alexandre Iooss , Peter Xu , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 07/19] hw/ahci: fix -Werror=maybe-uninitialized false-positive Date: Thu, 28 Mar 2024 14:20:40 +0400 Message-ID: <20240328102052.3499331-8-marcandre.lureau@redhat.com> In-Reply-To: <20240328102052.3499331-1-marcandre.lureau@redhat.com> References: <20240328102052.3499331-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1711621378797100003 From: Marc-Andr=C3=A9 Lureau ../hw/ide/ahci.c:989:58: error: =E2=80=98tbl_entry_size=E2=80=99 may be use= d uninitialized [-Werror=3Dmaybe-uninitialized] Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/ide/ahci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index bfefad2965..e89c92b7aa 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -948,7 +948,6 @@ static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGL= ist *sglist, uint64_t sum =3D 0; int off_idx =3D -1; int64_t off_pos =3D -1; - int tbl_entry_size; IDEBus *bus =3D &ad->port; BusState *qbus =3D BUS(bus); =20 @@ -976,6 +975,8 @@ static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGL= ist *sglist, /* Get entries in the PRDT, init a qemu sglist accordingly */ if (prdtl > 0) { AHCI_SG *tbl =3D (AHCI_SG *)prdt; + int tbl_entry_size =3D -1; + sum =3D 0; for (i =3D 0; i < prdtl; i++) { tbl_entry_size =3D prdt_tbl_entry_size(&tbl[i]); --=20 2.44.0 From nobody Wed May 22 00:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1711621363; cv=none; d=zohomail.com; s=zohoarc; b=V5eAjZibBuJN9LWthEzZMJPBqwm1PRZaf/KBmE6xCRkryDD9iAjysxuva2QnQSti0GFr189/3vP9pSWcETPVgVIj1GOPpKN5ioNX0Zio4dhWcwdfteVcNZzU0DKidsw6oiXHDY42yITydHyELv8mOpP6u8PuHGUtj7FioiIrDBY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711621363; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=brNznkesgm5sM6cu00vVLhBhhfdPMXzqKQMxNztlRXs=; b=S/Me4YejpM1R7ZgKPuOY36pxYeGwC9YamTq1Pin+eRdPyW1WJ7lpzXlQLym53oi7I0nLGkKzucFtcIpCzBYZgz6qXKwp9gFnKIFk1erAMy21e+dHH35DJLFRoqpVpQvFnx2e8waiETPGYfYAPuWyIWZSOOoLtIixjUdWkt2HYCc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1711621363971118.57325543206764; Thu, 28 Mar 2024 03:22:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpmtz-0003N6-97; Thu, 28 Mar 2024 06:22:31 -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 1rpmty-0003I3-9m for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:22:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rpmtw-0007lD-U0 for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:22:30 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-310-LfCy9EUyP5i1D_F6jCjsCg-1; Thu, 28 Mar 2024 06:22:23 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8021E29AC032; Thu, 28 Mar 2024 10:22:22 +0000 (UTC) Received: from localhost (unknown [10.39.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id A0CAC492BD0; Thu, 28 Mar 2024 10:22:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711621348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=brNznkesgm5sM6cu00vVLhBhhfdPMXzqKQMxNztlRXs=; b=g+3tbAEE1eQXlUgKyfL/aaQ4AcqKEy7xuB49uRwLhJs8U7PIUcn/zmgJyzdlc4MFBf6W/k ju3bEpEsr8Wb+tUpLxfse0Ovib68IWKWTbb2eNiupmOyXm78DjobkzJvsPDzS87cgXNTen sdpXYuW49QhEU/x7dTovFttVSPWVQTU= X-MC-Unique: LfCy9EUyP5i1D_F6jCjsCg-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Hyman Huang , Vladimir Sementsov-Ogievskiy , Paolo Bonzini , Gerd Hoffmann , qemu-block@nongnu.org, Kevin Wolf , Fabiano Rosas , Mahmoud Mandour , John Snow , Klaus Jensen , Fam Zheng , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Bin Meng , Hanna Reitz , Eric Blake , "Michael S. Tsirkin" , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yuval Shaia , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Jesper Devantier , Pierrick Bouvier , Keith Busch , Marcel Apfelbaum , Alexandre Iooss , Peter Xu , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 08/19] hw/vhost-scsi: fix -Werror=maybe-uninitialized Date: Thu, 28 Mar 2024 14:20:41 +0400 Message-ID: <20240328102052.3499331-9-marcandre.lureau@redhat.com> In-Reply-To: <20240328102052.3499331-1-marcandre.lureau@redhat.com> References: <20240328102052.3499331-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1711621364696100006 From: Marc-Andr=C3=A9 Lureau ../hw/scsi/vhost-scsi.c:173:12: error: =E2=80=98ret=E2=80=99 may be used un= initialized [-Werror=3Dmaybe-uninitialized] It can be reached when num_queues=3D0. It probably doesn't make much sense to instantiate a vhost-scsi with 0 IO queues though. For now, make vhost_scsi_set_workers() return success/0 anyway, when no workers have been setup. Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/scsi/vhost-scsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c index ae26bc19a4..5b066df4f7 100644 --- a/hw/scsi/vhost-scsi.c +++ b/hw/scsi/vhost-scsi.c @@ -170,7 +170,7 @@ static int vhost_scsi_set_workers(VHostSCSICommon *vsc,= bool per_virtqueue) struct vhost_dev *dev =3D &vsc->dev; struct vhost_vring_worker vq_worker; struct vhost_worker_state worker; - int i, ret; + int i, ret =3D 0; =20 /* Use default worker */ if (!per_virtqueue || dev->nvqs =3D=3D VHOST_SCSI_VQ_NUM_FIXED + 1) { --=20 2.44.0 From nobody Wed May 22 00:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1711621367; cv=none; d=zohomail.com; s=zohoarc; b=bD57ekhK94A6Fh28b4OohrNv5lopQx+CcPYjDMhp5H2no5dbBVbpMIivd1U5OLQ9OZS+mFXM9jiX92uVf0IngJWrOg3kCU9uFWoQ88dNAeqEnxXg/4MVkozVhOJYH8+EkvCaKpO+X0FDydneXLbUIOte7JH9ZaaGUKKfaJLe7N0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711621367; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Id6Tap1ND/e/Z5oRBTzfcA/u78wAx6yb1XvTTXVSj0E=; b=KcEAXDe+Ir3llFk53iiG5n4eIDXB0yLKVwWj8Jbr/bgCbFKdjFF2UaQkxiFzblN3+aTTbJcAfq9q/F8ImHP/SMAYJkS0UX7i/EQF91726eIoFzih+ESO2WWjg8UbklJEjuIWfXh4o3yjYB/EYGLfGIlTR9s0ED5zbzOac6AXPXc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1711621367723516.3259155200345; Thu, 28 Mar 2024 03:22:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpmu9-0004Wc-5k; Thu, 28 Mar 2024 06:22:41 -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 1rpmu7-0004MT-RL for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:22:39 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rpmu6-0007mC-3I for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:22:39 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-681-eUKddbu5MUiuhb2HPcq-hQ-1; Thu, 28 Mar 2024 06:22:32 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 333BF185A784; Thu, 28 Mar 2024 10:22:31 +0000 (UTC) Received: from localhost (unknown [10.39.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4476B17AA7; Thu, 28 Mar 2024 10:22:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711621357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Id6Tap1ND/e/Z5oRBTzfcA/u78wAx6yb1XvTTXVSj0E=; b=i5bM2JBKQxz3Z3mwATRJZ2ecq10MmGM+YihztiRU5C9YZwZn0qD8MdfYkrecLfrPewDHyS SPMREkw+/ep8NITGPjMY5o11+uoVziOQjQyjjXTKYQOUt2M7o6mcNYSJxPmndQMsY/bxRA WmZp3yhkrPxCV5H3l461nrwDjWhPJm8= X-MC-Unique: eUKddbu5MUiuhb2HPcq-hQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Hyman Huang , Vladimir Sementsov-Ogievskiy , Paolo Bonzini , Gerd Hoffmann , qemu-block@nongnu.org, Kevin Wolf , Fabiano Rosas , Mahmoud Mandour , John Snow , Klaus Jensen , Fam Zheng , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Bin Meng , Hanna Reitz , Eric Blake , "Michael S. Tsirkin" , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yuval Shaia , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Jesper Devantier , Pierrick Bouvier , Keith Busch , Marcel Apfelbaum , Alexandre Iooss , Peter Xu , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 09/19] hw/sdhci: fix -Werror=maybe-uninitialized false-positive Date: Thu, 28 Mar 2024 14:20:42 +0400 Message-ID: <20240328102052.3499331-10-marcandre.lureau@redhat.com> In-Reply-To: <20240328102052.3499331-1-marcandre.lureau@redhat.com> References: <20240328102052.3499331-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1711621368713100005 From: Marc-Andr=C3=A9 Lureau ../hw/sd/sdhci.c:846:16: error: =E2=80=98res=E2=80=99 may be used uninitial= ized [-Werror=3Dmaybe-uninitialized] False-positive, because "length" is non-null. Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/sd/sdhci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c index c5e0bc018b..da5351d4e5 100644 --- a/hw/sd/sdhci.c +++ b/hw/sd/sdhci.c @@ -745,7 +745,7 @@ static void sdhci_do_adma(SDHCIState *s) const uint16_t block_size =3D s->blksize & BLOCK_SIZE_MASK; const MemTxAttrs attrs =3D { .memory =3D true }; ADMADescr dscr =3D {}; - MemTxResult res; + MemTxResult res =3D MEMTX_ERROR; int i; =20 if (s->trnmod & SDHC_TRNS_BLK_CNT_EN && !s->blkcnt) { --=20 2.44.0 From nobody Wed May 22 00:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1711621388; cv=none; d=zohomail.com; s=zohoarc; b=nFQ/5UMR3VLF6OAXmAZQCSpiuLdWOfdKyRX7FrG4M9HzULHwyRymAZErNs2g2nN3JDWBKTUaI/ZEWVqX9oy39iq1vPtUhH941ZAdL5j1SYECX69El/pOfkf5V2kc/PsB3jUanKpnJf1FeIpWrOjrR2OaXxxILZQllCDHuxR2dOQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711621388; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=YLsMV3OPWyHGVz8JarPvB1XH8kzXFdChfi9w3FlmoSo=; b=LHA22A/lhff24Pj29YxyCwqLt4PoeRI/jEzkH8CTU7SA1by1lxo2E8Ce6at+yEJuRZgbDHkGMwArxcUvFZ/pob1V8zp4NdivTXr62ie61352JYHnqa3MKisZPReoFBkQxNB1ZmaOqq1R0hHRbdPpCncSBYcIgEnaxHBl8nAlZN0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1711621388467898.0436936060479; Thu, 28 Mar 2024 03:23:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpmuU-0007Cb-OW; Thu, 28 Mar 2024 06:23:02 -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 1rpmuT-0006yX-Du for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:23:01 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rpmuR-0007pH-Sy for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:23:01 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-66-WUgWo06zME-_6W3XydgGDA-1; Thu, 28 Mar 2024 06:22:55 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6700E3C02533; Thu, 28 Mar 2024 10:22:54 +0000 (UTC) Received: from localhost (unknown [10.39.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 49A1B3C20; Thu, 28 Mar 2024 10:22:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711621379; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YLsMV3OPWyHGVz8JarPvB1XH8kzXFdChfi9w3FlmoSo=; b=W17jlInYKxXQDXqbCiAQgmwjcelJp6+MQGCqV+bV14uELMeY1uvj5QOPC1PdVaxyygGnGA LaPtnokSnu+XilxK1ppGghdz6jSDcm7AtPuYjoUnQPnwRoBVA1kZdLtdyNQUVRSmwmY6Jx qhgrcGkxObapPMwl37rJk5Mj2bhOx24= X-MC-Unique: WUgWo06zME-_6W3XydgGDA-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Hyman Huang , Vladimir Sementsov-Ogievskiy , Paolo Bonzini , Gerd Hoffmann , qemu-block@nongnu.org, Kevin Wolf , Fabiano Rosas , Mahmoud Mandour , John Snow , Klaus Jensen , Fam Zheng , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Bin Meng , Hanna Reitz , Eric Blake , "Michael S. Tsirkin" , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yuval Shaia , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Jesper Devantier , Pierrick Bouvier , Keith Busch , Marcel Apfelbaum , Alexandre Iooss , Peter Xu , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 10/19] hw/rdma: fix -Werror=maybe-uninitialized false-positive Date: Thu, 28 Mar 2024 14:20:43 +0400 Message-ID: <20240328102052.3499331-11-marcandre.lureau@redhat.com> In-Reply-To: <20240328102052.3499331-1-marcandre.lureau@redhat.com> References: <20240328102052.3499331-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1711621390789100002 From: Marc-Andr=C3=A9 Lureau ../hw/rdma/rdma_backend.c:129:8: error: =E2=80=98ne=E2=80=99 may be used un= initialized [-Werror=3Dmaybe-uninitialized] Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/rdma/rdma_backend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/rdma/rdma_backend.c b/hw/rdma/rdma_backend.c index 6dcdfbbbe2..1ca485dd0d 100644 --- a/hw/rdma/rdma_backend.c +++ b/hw/rdma/rdma_backend.c @@ -90,7 +90,7 @@ static void clean_recv_mads(RdmaBackendDev *backend_dev) =20 static int rdma_poll_cq(RdmaDeviceResources *rdma_dev_res, struct ibv_cq *= ibcq) { - int i, ne, total_ne =3D 0; + int i, ne =3D -1, total_ne =3D 0; BackendCtx *bctx; struct ibv_wc wc[2]; RdmaProtectedGSList *cqe_ctx_list; --=20 2.44.0 From nobody Wed May 22 00:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1711621402; cv=none; d=zohomail.com; s=zohoarc; b=NBw5vyU0V2PJgp6rVdvzmXxgvkVGa7rZXGmrLoMy2+9/vO0YAlpe5+zDFpatQgPTFoYJ14SMgog67aYIajht5G+ociVX5RCr+koy4mDzCFgTVPmaPn7iR5gF8pl7f5GdJFhm+u1VZbbkz0d/xITBWHATuhHSARd6Y4kMV3WajtY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711621402; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=l0vLZIvCxAXQkQNjpsiTfM3Zgw33Bs4Dov1vg4na7ug=; b=bETF5ST7+PozRRKDRWCxe5pJPrluDx4XG9v3UGlqVxNmNoyFziehwzTH6w5A6hJDCS0TD1HSvfj7zsi91MH9HcTe2LbYMBoXYsYd1YwgbXwNULJrHOwi+5oAZfevMJpKiPtMuiBwVDcDKOmTd5vjI0WSak93cR0+5QZ83IdQ9lU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1711621402095431.285317696516; Thu, 28 Mar 2024 03:23:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpmul-0007dZ-Fy; Thu, 28 Mar 2024 06:23:19 -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 1rpmud-0007W8-KC for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:23:11 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rpmuc-0007qc-5e for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:23:11 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-53-s9kPCjWtO3mqm5T_iB-Sjw-1; Thu, 28 Mar 2024 06:23:05 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2BF78803FC7; Thu, 28 Mar 2024 10:23:03 +0000 (UTC) Received: from localhost (unknown [10.39.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4C599492BD7; Thu, 28 Mar 2024 10:23:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711621388; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=l0vLZIvCxAXQkQNjpsiTfM3Zgw33Bs4Dov1vg4na7ug=; b=heSGfaQbPw70gQ8JXa34u18VPgTbvQhcNp6kxxdQDnNXCP6tV8HHnI4Wq1ZXWPoNi6qnHt O2UrZexCyv/8qR2kai9uemLz8A9fQTkxu89uyBATEprsT6m8TAC0fT2dxnXBpd7AzJMwaU OX36cyyRQZypn4/5rh03GzUNEUBGa+0= X-MC-Unique: s9kPCjWtO3mqm5T_iB-Sjw-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Hyman Huang , Vladimir Sementsov-Ogievskiy , Paolo Bonzini , Gerd Hoffmann , qemu-block@nongnu.org, Kevin Wolf , Fabiano Rosas , Mahmoud Mandour , John Snow , Klaus Jensen , Fam Zheng , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Bin Meng , Hanna Reitz , Eric Blake , "Michael S. Tsirkin" , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yuval Shaia , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Jesper Devantier , Pierrick Bouvier , Keith Busch , Marcel Apfelbaum , Alexandre Iooss , Peter Xu , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 11/19] migration/block: fix -Werror=maybe-uninitialized false-positive Date: Thu, 28 Mar 2024 14:20:44 +0400 Message-ID: <20240328102052.3499331-12-marcandre.lureau@redhat.com> In-Reply-To: <20240328102052.3499331-1-marcandre.lureau@redhat.com> References: <20240328102052.3499331-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1711621402860100003 From: Marc-Andr=C3=A9 Lureau ../migration/block.c:966:16: error: =E2=80=98ret=E2=80=99 may be used unini= tialized [-Werror=3Dmaybe-uninitialized] Given that "cluster_size" must be <=3D BLK_MIG_BLOCK_SIZE, the previous loop is entered at least once, so 'ret' is assigned a value in all conditio= ns. Signed-off-by: Marc-Andr=C3=A9 Lureau Acked-by: Peter Xu --- migration/block.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/block.c b/migration/block.c index 2b9054889a..486b1bec03 100644 --- a/migration/block.c +++ b/migration/block.c @@ -877,7 +877,7 @@ static int block_load(QEMUFile *f, void *opaque, int ve= rsion_id) uint8_t *buf; int64_t total_sectors =3D 0; int nr_sectors; - int ret; + int ret =3D -EINVAL; BlockDriverInfo bdi; int cluster_size =3D BLK_MIG_BLOCK_SIZE; =20 --=20 2.44.0 From nobody Wed May 22 00:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1711621408; cv=none; d=zohomail.com; s=zohoarc; b=bNwrggOtB5v/mMM0F9cv5RCgSvY1unjsD1T3TKnmaov0gMMCQA5DXYSzpfSlcwBN2sUAAcUms2P0Y5DO0uKcoDYHK6KISVJaBwABzjvFhr/SsyukLNcnTwiog5x9UFHFKm+8W+4d7WtvcE/NFWHK1LDhzKlN1DWQJIZ9UBNHQps= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711621408; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=acVh+/q6KY41u8ad+OHkKnZLq8ZGC8P1uBZmJsqBzzg=; b=dZBLZnomffAcOzEOpj1DpMsL3NDx+RvudIXffqwH8KUdKTmjVVQCAGFmaknu8LeivlPRiwHqk54Scp2g/t0ZsO+fwRoZR5Ay6CRQcIdV6RtMlrs7JvTMUFjOKphmNPNOdmJkqYyg/UQ/mzLdAfanJMyFEu5zEjqQC/TDEtYqkzA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1711621408106306.59311219280085; Thu, 28 Mar 2024 03:23:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpmur-0007s8-UJ; Thu, 28 Mar 2024 06:23:25 -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 1rpmul-0007hS-DV for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:23:19 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rpmuk-0007re-1h for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:23:19 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-649-vAnWjIWyPIOl2o7vc8gn7w-1; Thu, 28 Mar 2024 06:23:13 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6151F3815EF6; Thu, 28 Mar 2024 10:23:12 +0000 (UTC) Received: from localhost (unknown [10.39.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 368B01121306; Thu, 28 Mar 2024 10:23:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711621397; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=acVh+/q6KY41u8ad+OHkKnZLq8ZGC8P1uBZmJsqBzzg=; b=Zo+Rnlbf9eQh9Gq1OhKC1OpOQ25cLaJ7bVcbrJEoMQA4MKvapaMdCoQKo7hK12k9w6lg+f ln++iAvlASgEq+gCwkayRB96RVCeguY3wv+ItcJZwfrn4J0ixYBXdVfiM6aeLP1XWPo7Xy 6B0TEhX97Aq5gti8jBYNKR2MRbNzr0Q= X-MC-Unique: vAnWjIWyPIOl2o7vc8gn7w-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Hyman Huang , Vladimir Sementsov-Ogievskiy , Paolo Bonzini , Gerd Hoffmann , qemu-block@nongnu.org, Kevin Wolf , Fabiano Rosas , Mahmoud Mandour , John Snow , Klaus Jensen , Fam Zheng , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Bin Meng , Hanna Reitz , Eric Blake , "Michael S. Tsirkin" , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yuval Shaia , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Jesper Devantier , Pierrick Bouvier , Keith Busch , Marcel Apfelbaum , Alexandre Iooss , Peter Xu , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 12/19] migration: fix -Werror=maybe-uninitialized false-positives Date: Thu, 28 Mar 2024 14:20:45 +0400 Message-ID: <20240328102052.3499331-13-marcandre.lureau@redhat.com> In-Reply-To: <20240328102052.3499331-1-marcandre.lureau@redhat.com> References: <20240328102052.3499331-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1711621408859100003 From: Marc-Andr=C3=A9 Lureau ../migration/dirtyrate.c:186:5: error: =E2=80=98records=E2=80=99 may be use= d uninitialized [-Werror=3Dmaybe-uninitialized] ../migration/dirtyrate.c:168:12: error: =E2=80=98gen_id=E2=80=99 may be use= d uninitialized [-Werror=3Dmaybe-uninitialized] ../migration/migration.c:2273:5: error: =E2=80=98file=E2=80=99 may be used = uninitialized [-Werror=3Dmaybe-uninitialized] Signed-off-by: Marc-Andr=C3=A9 Lureau Acked-by: Peter Xu Reviewed-by: Hyman Huang --- migration/dirtyrate.c | 4 ++-- migration/migration.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/migration/dirtyrate.c b/migration/dirtyrate.c index 1d2e85746f..22dd22922c 100644 --- a/migration/dirtyrate.c +++ b/migration/dirtyrate.c @@ -144,12 +144,12 @@ int64_t vcpu_calculate_dirtyrate(int64_t calc_time_ms, unsigned int flag, bool one_shot) { - DirtyPageRecord *records; + DirtyPageRecord *records =3D NULL; int64_t init_time_ms; int64_t duration; int64_t dirtyrate; int i =3D 0; - unsigned int gen_id; + unsigned int gen_id =3D 0; =20 retry: init_time_ms =3D qemu_clock_get_ms(QEMU_CLOCK_REALTIME); diff --git a/migration/migration.c b/migration/migration.c index 9fe8fd2afd..412138ea94 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -2247,7 +2247,7 @@ static bool migrate_handle_rp_resume_ack(MigrationSta= te *s, */ static void migration_release_dst_files(MigrationState *ms) { - QEMUFile *file; + QEMUFile *file =3D NULL; =20 WITH_QEMU_LOCK_GUARD(&ms->qemu_file_lock) { /* --=20 2.44.0 From nobody Wed May 22 00:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1711621423; cv=none; d=zohomail.com; s=zohoarc; b=ak7ixbJi5d0JN6uu5QKz/ng1keATTBIjvFI4ztpS2URt7wIJPuzKpfbBO9AbFHa6b6iLPF7UdHTh40u464bHsgmPqAH5wFUpczgEr1zkmw4lAXfGOK9Ig6u4ErovkCOTarSZFYwTQOm2h/oaEGvj4lqiEmZkJdiB0snh/sPkGsc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711621423; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=1hk5jvG8/EYb2j3QGk2f/hNpiklja/ZssR+kAbmUWj4=; b=lzn3O1mAZxdhS3epDENMY8kDzghXxBdwbCmcZ/abh6PYAN2huxWtR9+LiRntv/CV0ICtt1x8Fyh1XTxPNIjXx0FRw8K7ATA6Wv0a/9dui5M/tbMUmjtG7hBMJ8pIyqkjnwFVAb65yKP35MrIndD4CgmzhGAe0eJyxW/STwgMDiI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 171162142301386.03658043979158; Thu, 28 Mar 2024 03:23:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpmuv-0008Bk-Rf; Thu, 28 Mar 2024 06:23:29 -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 1rpmuu-000880-QX for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:23:28 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rpmut-0007sL-Dw for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:23:28 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-477-UAcyM3o_NOy-Ne3Ya7zLqQ-1; Thu, 28 Mar 2024 06:23:21 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CCDA33C0244C; Thu, 28 Mar 2024 10:23:20 +0000 (UTC) Received: from localhost (unknown [10.39.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 071522166B31; Thu, 28 Mar 2024 10:23:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711621405; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1hk5jvG8/EYb2j3QGk2f/hNpiklja/ZssR+kAbmUWj4=; b=D2qsTCYZGX+yWBWO1OIzZ7L9TC8Vd+x2CSZL0jbtSp8QQTC6/Zbt02uM/2bYvSI72TXM6g U4qml/DCWAhVmVZ1upBl5saD4BDeuJbnvdRFaf29WQ3HDqZKmQ79NRGUA9twuXIqHoHN4a /RLuKHVet5y9eenl2iR5Ifw9gS0D0ww= X-MC-Unique: UAcyM3o_NOy-Ne3Ya7zLqQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Hyman Huang , Vladimir Sementsov-Ogievskiy , Paolo Bonzini , Gerd Hoffmann , qemu-block@nongnu.org, Kevin Wolf , Fabiano Rosas , Mahmoud Mandour , John Snow , Klaus Jensen , Fam Zheng , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Bin Meng , Hanna Reitz , Eric Blake , "Michael S. Tsirkin" , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yuval Shaia , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Jesper Devantier , Pierrick Bouvier , Keith Busch , Marcel Apfelbaum , Alexandre Iooss , Peter Xu , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 13/19] hw/virtio-blk: fix -Werror=maybe-uninitialized false-positive Date: Thu, 28 Mar 2024 14:20:46 +0400 Message-ID: <20240328102052.3499331-14-marcandre.lureau@redhat.com> In-Reply-To: <20240328102052.3499331-1-marcandre.lureau@redhat.com> References: <20240328102052.3499331-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1711621424874100003 From: Marc-Andr=C3=A9 Lureau ../hw/block/virtio-blk.c:1212:12: error: =E2=80=98rq=E2=80=99 may be used u= ninitialized [-Werror=3Dmaybe-uninitialized] Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Stefan Hajnoczi --- hw/block/virtio-blk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index 92de315f17..ce660ff9fe 100644 --- a/hw/block/virtio-blk.c +++ b/hw/block/virtio-blk.c @@ -1195,7 +1195,7 @@ static void virtio_blk_dma_restart_cb(void *opaque, b= ool running, VirtIOBlock *s =3D opaque; uint16_t num_queues =3D s->conf.num_queues; g_autofree VirtIOBlockReq **vq_rq =3D NULL; - VirtIOBlockReq *rq; + VirtIOBlockReq *rq =3D NULL; =20 if (!running) { return; --=20 2.44.0 From nobody Wed May 22 00:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1711621466; cv=none; d=zohomail.com; s=zohoarc; b=R4u9E6J0z/S7qloO15zDKrEkgbR71fYtc912+9h9hjSM9NbyK5//QFTCqSFjBwm/ypmiUY+ig25uGkdqvm7h2kZzbp8EjVmVDy6zLHBKWzROQze4XyTARvpTw95xhkP0TaxvsoV9PeCrVuVw7wzmA0QohrlkJxYzEvU5uhGhWZc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711621466; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=fgfwzow+4Jsf+TO10VCGSpO899Fz7eUuDTBoX+hINc8=; b=j5mXtg3Lan2mzTv785As4xhKwViKWGiLA3M02O80r+vThOJ+z1UeI+p5DbllMhPEbcUb4V7pvgV+2pCu0OhAH21G/qWAF9CY9/z/nDZs/pddWF1HcHVs5RM0HvTntiG00aG0S6gxLk2+/unLZ8o6GNUgW8Qkr8Hn3cqWVrCLezk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17116214665501006.8153248897094; Thu, 28 Mar 2024 03:24:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpmvB-0000cY-9F; Thu, 28 Mar 2024 06:23:45 -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 1rpmv9-0000Q4-66 for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:23:43 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rpmv7-0007yF-PL for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:23:42 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-263-EPKhKRf0OAy_mJfexHTMyw-1; Thu, 28 Mar 2024 06:23:31 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id ECE011C02154; Thu, 28 Mar 2024 10:23:29 +0000 (UTC) Received: from localhost (unknown [10.39.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0A9B0492BC6; Thu, 28 Mar 2024 10:23:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711621418; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fgfwzow+4Jsf+TO10VCGSpO899Fz7eUuDTBoX+hINc8=; b=CeMu0xjjXDD5pJNwKcY4ZiCJW9slhx0qfwThFYRBSEjlLOevPdRh8f4v5gDs4gpEH3Q6an U+IexJmfBEH0G1u1cSjcIgGctF0PaYeuThsWNFVQF3nS2isnfTckcY2q+0vaXOXtP+zvQw ycZoZCWG6pQQuzESujJmqAYPPNc21AM= X-MC-Unique: EPKhKRf0OAy_mJfexHTMyw-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Hyman Huang , Vladimir Sementsov-Ogievskiy , Paolo Bonzini , Gerd Hoffmann , qemu-block@nongnu.org, Kevin Wolf , Fabiano Rosas , Mahmoud Mandour , John Snow , Klaus Jensen , Fam Zheng , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Bin Meng , Hanna Reitz , Eric Blake , "Michael S. Tsirkin" , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yuval Shaia , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Jesper Devantier , Pierrick Bouvier , Keith Busch , Marcel Apfelbaum , Alexandre Iooss , Peter Xu , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 14/19] plugins: fix -Werror=maybe-uninitialized false-positive Date: Thu, 28 Mar 2024 14:20:47 +0400 Message-ID: <20240328102052.3499331-15-marcandre.lureau@redhat.com> In-Reply-To: <20240328102052.3499331-1-marcandre.lureau@redhat.com> References: <20240328102052.3499331-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1711621466976100006 From: Marc-Andr=C3=A9 Lureau ../plugins/loader.c:405:15: error: =E2=80=98ctx=E2=80=99 may be used uninit= ialized [-Werror=3Dmaybe-uninitialized] Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Pierrick Bouvier --- plugins/loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/loader.c b/plugins/loader.c index 9768b78eb6..513a429c57 100644 --- a/plugins/loader.c +++ b/plugins/loader.c @@ -390,7 +390,7 @@ void plugin_reset_uninstall(qemu_plugin_id_t id, bool reset) { struct qemu_plugin_reset_data *data; - struct qemu_plugin_ctx *ctx; + struct qemu_plugin_ctx *ctx =3D NULL; =20 WITH_QEMU_LOCK_GUARD(&plugin.lock) { ctx =3D plugin_id_to_ctx_locked(id); --=20 2.44.0 From nobody Wed May 22 00:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1711621465; cv=none; d=zohomail.com; s=zohoarc; b=FPheDsHTaxLUqeVUSHcWloM/NslwstEI6nJPrWApGi2ZQqbZznFgB50VmBiRCaF955T261MzFfiXB1FZkZJYcFnFdkVJ6vhgDVd2SNUWWgm/tG/G9uXaMfyO02ubCWrtDOFQNuVvIK/dwNY1LAM+CGK2FoUrSzq3wWKQJ0qNKgo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711621465; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=wk1XRuu9X3DGzJxFGHocnOKx8XCL2jR00QO4qFqvTGA=; b=HO/zTuReUTeUYPIOupQFgA3QiD+UxcFCot47v8MxBXUbY/pT+fc3FftwXKjJVGhfQsIMiM/m2ctZZ5Mth6Hy1rdLRf7xYTJ8XS4wTB4bl1sAt440x9f9SSpI2rgyRURgyjVgtIVl72d2nPizes3PcnregDLJiT7oRlDj9hsUKSY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1711621465986267.27761529654776; Thu, 28 Mar 2024 03:24:25 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpmvC-0000g5-2p; Thu, 28 Mar 2024 06:23:46 -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 1rpmvA-0000Uz-BE for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:23:44 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rpmv8-0007yU-Nz for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:23:43 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-228-sSAzZxhyPW6b9zPDUyChhQ-1; Thu, 28 Mar 2024 06:23:39 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C71421C02156; Thu, 28 Mar 2024 10:23:38 +0000 (UTC) Received: from localhost (unknown [10.39.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id F4235492BC6; Thu, 28 Mar 2024 10:23:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711621422; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wk1XRuu9X3DGzJxFGHocnOKx8XCL2jR00QO4qFqvTGA=; b=iAaopNLwzm0r6x/0u+IlslFXvQzACzYY8Lx5/n5Aq15gsO3yb5Q+4g5IWGd0JXwnBBF+as 8jFWVJi3BKYhm6ev9L1FV9SCp9LyLOGN4BN9oRybxEAD0buVrpiKHcT4ohtn1Xuyx98hB1 tXOM2+nLwVZZXWZxwiVQ63ZEw55cZBQ= X-MC-Unique: sSAzZxhyPW6b9zPDUyChhQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Hyman Huang , Vladimir Sementsov-Ogievskiy , Paolo Bonzini , Gerd Hoffmann , qemu-block@nongnu.org, Kevin Wolf , Fabiano Rosas , Mahmoud Mandour , John Snow , Klaus Jensen , Fam Zheng , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Bin Meng , Hanna Reitz , Eric Blake , "Michael S. Tsirkin" , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yuval Shaia , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Jesper Devantier , Pierrick Bouvier , Keith Busch , Marcel Apfelbaum , Alexandre Iooss , Peter Xu , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 15/19] migration: fix -Werror=maybe-uninitialized false-positive Date: Thu, 28 Mar 2024 14:20:48 +0400 Message-ID: <20240328102052.3499331-16-marcandre.lureau@redhat.com> In-Reply-To: <20240328102052.3499331-1-marcandre.lureau@redhat.com> References: <20240328102052.3499331-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1711621466976100005 From: Marc-Andr=C3=A9 Lureau ../migration/ram.c:1873:23: error: =E2=80=98dirty=E2=80=99 may be used unin= itialized [-Werror=3Dmaybe-uninitialized] When 'block' !=3D NULL, 'dirty' is initialized. Signed-off-by: Marc-Andr=C3=A9 Lureau Acked-by: Peter Xu --- migration/ram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/ram.c b/migration/ram.c index 8deb84984f..4e26bced31 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -1847,7 +1847,7 @@ static bool get_queued_page(RAMState *rs, PageSearchS= tatus *pss) { RAMBlock *block; ram_addr_t offset; - bool dirty; + bool dirty =3D false; =20 do { block =3D unqueue_page(rs, &offset); --=20 2.44.0 From nobody Wed May 22 00:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1711621469; cv=none; d=zohomail.com; s=zohoarc; b=UNYVqtx8yMxFBFYwXw1ExZNW7TfoIx1j2vJCEAUtUT4MngGKvb/R9GbEQxo53ZJ0ulHO527n1ld20p0iLXAKNTGEO+bUKSDIYHFkSQal2rFz8kqQ7MtZnZ8oUywLx8E+vQTUvu5rW6yIR3bPJvVhIUPdN8cFigQPD2hDdVew5/o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711621469; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=XNL8vvRnydn7jCDetNfo6f12bNGtxUMZ0TRYkoRAnyo=; b=g53IaQKFFrxXsxhvdStiY1TZh2BEX0PN16+/SFzg7L/vES/tDXLYMqJAhCS0T2yveeWwznodavooM4oT+9IGMkkqhYIKution37itaQPqAWmidF/9YL5p913HMmht5w4/9vqbwTgg+3mUsnKne5TNHpmLiiR4W3DVH7bldIBI0M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1711621469733866.5165580935809; Thu, 28 Mar 2024 03:24:29 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpmve-0001K3-Nf; Thu, 28 Mar 2024 06:24:15 -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 1rpmvP-00018B-2s for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:24:02 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rpmvM-000818-Ei for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:23:58 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-628-iPBfTMEtO4mDpBsoSw7A0Q-1; Thu, 28 Mar 2024 06:23:48 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7660E29AC032; Thu, 28 Mar 2024 10:23:47 +0000 (UTC) Received: from localhost (unknown [10.39.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 92DF6492BC8; Thu, 28 Mar 2024 10:23:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711621432; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XNL8vvRnydn7jCDetNfo6f12bNGtxUMZ0TRYkoRAnyo=; b=Ik1Fp5jXEBohFkJOM4ODCyL14gdICiJx5FWhWNG0n1DYheZlxeN0hDQLpG8k23/ZegjQqL vVTOJRF51M7cCLs7i5WA/4fSyYFLRfEqQRfW2yW9ahQ9MmvOd9eeKw5bD5U3XLSCAv9IvL ZVMAJbUpzIeFGUFGa65V9jURrUKoi2M= X-MC-Unique: iPBfTMEtO4mDpBsoSw7A0Q-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Hyman Huang , Vladimir Sementsov-Ogievskiy , Paolo Bonzini , Gerd Hoffmann , qemu-block@nongnu.org, Kevin Wolf , Fabiano Rosas , Mahmoud Mandour , John Snow , Klaus Jensen , Fam Zheng , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Bin Meng , Hanna Reitz , Eric Blake , "Michael S. Tsirkin" , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yuval Shaia , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Jesper Devantier , Pierrick Bouvier , Keith Busch , Marcel Apfelbaum , Alexandre Iooss , Peter Xu , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 16/19] tests: fix -Werror=maybe-uninitialized Date: Thu, 28 Mar 2024 14:20:49 +0400 Message-ID: <20240328102052.3499331-17-marcandre.lureau@redhat.com> In-Reply-To: <20240328102052.3499331-1-marcandre.lureau@redhat.com> References: <20240328102052.3499331-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1711621470999100003 From: Marc-Andr=C3=A9 Lureau ../tests/unit/test-block-iothread.c:773:17: error: =E2=80=98job=E2=80=99 ma= y be used uninitialized [-Werror=3Dmaybe-uninitialized] /usr/include/glib-2.0/glib/gtestutils.h:73:53: error: =E2=80=98ret=E2=80=99= may be used uninitialized [-Werror=3Dmaybe-uninitialized] Signed-off-by: Marc-Andr=C3=A9 Lureau --- tests/unit/test-bdrv-drain.c | 2 +- tests/unit/test-block-iothread.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/test-bdrv-drain.c b/tests/unit/test-bdrv-drain.c index 666880472b..c112d5b189 100644 --- a/tests/unit/test-bdrv-drain.c +++ b/tests/unit/test-bdrv-drain.c @@ -722,7 +722,7 @@ static void test_blockjob_common_drain_node(enum drain_= type drain_type, BlockJob *job; TestBlockJob *tjob; IOThread *iothread =3D NULL; - int ret; + int ret =3D -1; =20 src =3D bdrv_new_open_driver(&bdrv_test, "source", BDRV_O_RDWR, &error_abort); diff --git a/tests/unit/test-block-iothread.c b/tests/unit/test-block-iothr= ead.c index 3766d5de6b..20ed54f570 100644 --- a/tests/unit/test-block-iothread.c +++ b/tests/unit/test-block-iothread.c @@ -745,7 +745,7 @@ static void test_propagate_mirror(void) AioContext *main_ctx =3D qemu_get_aio_context(); BlockDriverState *src, *target, *filter; BlockBackend *blk; - Job *job; + Job *job =3D NULL; Error *local_err =3D NULL; =20 /* Create src and target*/ --=20 2.44.0 From nobody Wed May 22 00:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1711621477; cv=none; d=zohomail.com; s=zohoarc; b=joJ3DESWZ0dZn635Gx8i3fyyC8G+D76TTZXio1l2R0A8z0cbZTUC0n5kS+XNEDCaZNKT3w5fe4mAK3fcQyzzwvxEwdmmmsgdnE0kIRgzInmDK+Os1p9KK0IIhC8LLLF2nsJGo0OPBKdpJZ95ReN/+Ed5QyUC/Xk/DdqkZzGxO4k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711621477; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Yq8tTYx/XLUB4Gx0moxVhK0EJnB47ElooeGni6U2KHU=; b=EqTrb/szyzGIg+aLMo6cBycLU3qBaIIM7ATJoNq5DQ39KYQXNv97ZOrPuYI01rTEFG8OeWGP6eI/o0y9r9zJLwrkhdqaYBw1kkWtl169PV0f79wStwtIu36HlDzHXLrSJhaIzyGFVupK8/lfVr/f+HIzDQhOQr0DFKDb6SyyJOQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 171162147796218.45252311670845; Thu, 28 Mar 2024 03:24:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpmvo-0001qc-2C; Thu, 28 Mar 2024 06:24:24 -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 1rpmvm-0001ft-SO for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:24:22 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rpmve-00081z-Ib for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:24:15 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-668--SLuRppQOwuCV8NX8L6XsQ-1; Thu, 28 Mar 2024 06:24:11 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3EBF6811E81; Thu, 28 Mar 2024 10:24:10 +0000 (UTC) Received: from localhost (unknown [10.39.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 45E373C20; Thu, 28 Mar 2024 10:24:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711621454; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Yq8tTYx/XLUB4Gx0moxVhK0EJnB47ElooeGni6U2KHU=; b=Muu9yLsCTY52Cl8uY5wFx4raKN2Zd5ttyp0m2w0ITaVBFtseRCFOgWb5mEfXt18Gqwh/1Y p5n/pMpYH5GON8rQjuBN7VJZT9jQF5YdvO8XwvJF9c+C8s2O/sTwR4LuqoztGKr7pM06px WajW3VfgEnuq6vmgZSL9Jtus4D3gXxs= X-MC-Unique: -SLuRppQOwuCV8NX8L6XsQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Hyman Huang , Vladimir Sementsov-Ogievskiy , Paolo Bonzini , Gerd Hoffmann , qemu-block@nongnu.org, Kevin Wolf , Fabiano Rosas , Mahmoud Mandour , John Snow , Klaus Jensen , Fam Zheng , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Bin Meng , Hanna Reitz , Eric Blake , "Michael S. Tsirkin" , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yuval Shaia , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Jesper Devantier , Pierrick Bouvier , Keith Busch , Marcel Apfelbaum , Alexandre Iooss , Peter Xu , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 17/19] hw/nvme: fix -Werror=maybe-uninitialized Date: Thu, 28 Mar 2024 14:20:50 +0400 Message-ID: <20240328102052.3499331-18-marcandre.lureau@redhat.com> In-Reply-To: <20240328102052.3499331-1-marcandre.lureau@redhat.com> References: <20240328102052.3499331-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1711621478995100003 From: Marc-Andr=C3=A9 Lureau ../hw/nvme/ctrl.c:6081:21: error: =E2=80=98result=E2=80=99 may be used unin= itialized [-Werror=3Dmaybe-uninitialized] It's not obvious that 'result' is set in all code paths. When &result is a returned argument, it's even less clear. Looking at various assignments, 0 seems to be a suitable default value. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Klaus Jensen --- hw/nvme/ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index c2b17de987..127c3d2383 100644 --- a/hw/nvme/ctrl.c +++ b/hw/nvme/ctrl.c @@ -5894,7 +5894,7 @@ static uint16_t nvme_get_feature(NvmeCtrl *n, NvmeReq= uest *req) uint32_t dw10 =3D le32_to_cpu(cmd->cdw10); uint32_t dw11 =3D le32_to_cpu(cmd->cdw11); uint32_t nsid =3D le32_to_cpu(cmd->nsid); - uint32_t result; + uint32_t result =3D 0; uint8_t fid =3D NVME_GETSETFEAT_FID(dw10); NvmeGetFeatureSelect sel =3D NVME_GETFEAT_SELECT(dw10); uint16_t iv; --=20 2.44.0 From nobody Wed May 22 00:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1711621493; cv=none; d=zohomail.com; s=zohoarc; b=ho/qccXVtXbQuI0Ja3zzM02xmy0urrEaGJj/oxqS7e8pIu0LLFuRYqooOCVRrfKor5sG8AaAX5/FQNi8xrozm2ZvYEgChO0A+5bP1802KPGVv1zZEjCBN+0a52/G3c1eFrboBzBWjOGtoejEQ151M/ONrgquXfdlGd3J21Lp8CQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711621493; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ZaMpwY19pcCqO5xFBKSdLJ7yo1YyaKqcLtzVGkXev9w=; b=myhASJOulKtzlZVPdvUxaRgbz8D6x+UJxVOvSFZv8Qu6YtrmTws9+GGM1mp1AxnJ6Vc0RmlLODWEwn+mE2U7DtEp6z8+tfF+CINd/M/KP2Kdu7r0sh9kM5hJBP86nTik4NsX0kKTB7ZbHaz3LvMQsgMSqz1IKvX1KbtaPro7gKE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 171162149350615.15121579136121; Thu, 28 Mar 2024 03:24:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpmvv-0002yt-EI; Thu, 28 Mar 2024 06:24:31 -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 1rpmvu-0002s4-DO for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:24:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rpmvs-00083l-Cb for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:24:30 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-439-gyoeTz-gOLi9TDKS68wy6g-1; Thu, 28 Mar 2024 06:24:20 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4091A800264; Thu, 28 Mar 2024 10:24:19 +0000 (UTC) Received: from localhost (unknown [10.39.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6E5681C060DC; Thu, 28 Mar 2024 10:24:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711621467; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZaMpwY19pcCqO5xFBKSdLJ7yo1YyaKqcLtzVGkXev9w=; b=Fj+r45tcqU2At9iaZWj8H9QjL1LzEA5MMsG6OcFwSqWU/ReqHIYi3bqrpUL6mttTOPdXU/ jnsJQas4D8UBhJ4TYdtdp8lWLkE7wMjdmn474Rz5y7ir574bQjHiRTBdNBc7c53+6F3BZg RolLOc9uxY1j1EMWw5nIx4rCO1OOcfU= X-MC-Unique: gyoeTz-gOLi9TDKS68wy6g-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Hyman Huang , Vladimir Sementsov-Ogievskiy , Paolo Bonzini , Gerd Hoffmann , qemu-block@nongnu.org, Kevin Wolf , Fabiano Rosas , Mahmoud Mandour , John Snow , Klaus Jensen , Fam Zheng , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Bin Meng , Hanna Reitz , Eric Blake , "Michael S. Tsirkin" , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yuval Shaia , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Jesper Devantier , Pierrick Bouvier , Keith Busch , Marcel Apfelbaum , Alexandre Iooss , Peter Xu , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 18/19] hw/virtio: fix -Werror=maybe-uninitialized Date: Thu, 28 Mar 2024 14:20:51 +0400 Message-ID: <20240328102052.3499331-19-marcandre.lureau@redhat.com> In-Reply-To: <20240328102052.3499331-1-marcandre.lureau@redhat.com> References: <20240328102052.3499331-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1711621495049100003 From: Marc-Andr=C3=A9 Lureau ../hw/virtio/vhost-shadow-virtqueue.c:545:13: error: =E2=80=98r=E2=80=99 ma= y be used uninitialized [-Werror=3Dmaybe-uninitialized] '&r' is not guaranteed to be assigned when calling -Werror=3Dmaybe-uninitia= lized. Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/virtio/vhost-shadow-virtqueue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/virtio/vhost-shadow-virtqueue.c b/hw/virtio/vhost-shadow-vi= rtqueue.c index fc5f408f77..cd29cc795b 100644 --- a/hw/virtio/vhost-shadow-virtqueue.c +++ b/hw/virtio/vhost-shadow-virtqueue.c @@ -526,7 +526,7 @@ static void vhost_svq_flush(VhostShadowVirtqueue *svq, size_t vhost_svq_poll(VhostShadowVirtqueue *svq, size_t num) { size_t len =3D 0; - uint32_t r; + uint32_t r =3D 0; =20 while (num--) { int64_t start_us =3D g_get_monotonic_time(); --=20 2.44.0 From nobody Wed May 22 00:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1711621496; cv=none; d=zohomail.com; s=zohoarc; b=SDXcxsWvBbjZ9GoQ0C6aW14Po4+3Lc3B0VGgt+cwBH+R1++lx9QZTVHQqFj0zI5J3ffxEHxKii2nrt48IcbqqhciEyIyT2ZmrD2KkrcuM6d4Qxf6eZLJM8s/3dNIhTDDahkcYZAMK9EfJRsvFJwhWJ3jPNRLKi5o2fpsrwAmMWw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711621496; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=oHRMzYEm8O07qCC1WuSIUkd0l/2v6McOwpmBcpQ2w5Q=; b=kluc8PEIqx+7AeXAHq/o9GDZ5+9TN+ofMYoxHURxK8Zzthl/7RUlijp4eFY0Z/zOIXHVGMxCXcOW0K46b9ffFBwSNYWi0kurdEsszAUi23htQExzVq7Wxy/MkIi2jcztkMt1hTzFVIKvR/ZaGRCABzaiT8syYgKF82e/9cSdfE4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1711621496879304.8443343967025; Thu, 28 Mar 2024 03:24:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpmw1-000394-2j; Thu, 28 Mar 2024 06:24: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 1rpmvz-00037s-FI for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:24:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rpmvx-00084U-Rb for qemu-devel@nongnu.org; Thu, 28 Mar 2024 06:24:35 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-557-R184r4QNOt6w4r65TNpR3Q-1; Thu, 28 Mar 2024 06:24:29 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 20E8A801901; Thu, 28 Mar 2024 10:24:28 +0000 (UTC) Received: from localhost (unknown [10.39.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4B065492BD7; Thu, 28 Mar 2024 10:24:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711621473; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oHRMzYEm8O07qCC1WuSIUkd0l/2v6McOwpmBcpQ2w5Q=; b=h4c5joO1H2Shi4UFKFcfYYkQf6wcKvSIb2twiMAozBgtVwt8vtNZ9QxFjkim1dZR4yq71a Kx6MMrFIg3TU2GqRY5IK5QMvzOQgDdenCLMx3YKJERUxWquMclEDLYU4I4J/JfPIYYlltD gVQ66RQXvCFmAusNaE5X4qDfsfCvHcY= X-MC-Unique: R184r4QNOt6w4r65TNpR3Q-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Hyman Huang , Vladimir Sementsov-Ogievskiy , Paolo Bonzini , Gerd Hoffmann , qemu-block@nongnu.org, Kevin Wolf , Fabiano Rosas , Mahmoud Mandour , John Snow , Klaus Jensen , Fam Zheng , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Bin Meng , Hanna Reitz , Eric Blake , "Michael S. Tsirkin" , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yuval Shaia , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Jesper Devantier , Pierrick Bouvier , Keith Busch , Marcel Apfelbaum , Alexandre Iooss , Peter Xu , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 19/19] RFC: hw/virtio: a potential leak fix Date: Thu, 28 Mar 2024 14:20:52 +0400 Message-ID: <20240328102052.3499331-20-marcandre.lureau@redhat.com> In-Reply-To: <20240328102052.3499331-1-marcandre.lureau@redhat.com> References: <20240328102052.3499331-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1711621497044100005 From: Marc-Andr=C3=A9 Lureau vhost_svq_get_buf() may return a VirtQueueElement that should be freed. It's unclear to me if the vhost_svq_get_buf() call should always return NUL= L. Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/virtio/vhost-shadow-virtqueue.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/virtio/vhost-shadow-virtqueue.c b/hw/virtio/vhost-shadow-vi= rtqueue.c index cd29cc795b..93742d9ddc 100644 --- a/hw/virtio/vhost-shadow-virtqueue.c +++ b/hw/virtio/vhost-shadow-virtqueue.c @@ -414,6 +414,7 @@ static uint16_t vhost_svq_last_desc_of_chain(const Vhos= tShadowVirtqueue *svq, return i; } =20 +G_GNUC_WARN_UNUSED_RESULT static VirtQueueElement *vhost_svq_get_buf(VhostShadowVirtqueue *svq, uint32_t *len) { @@ -529,6 +530,7 @@ size_t vhost_svq_poll(VhostShadowVirtqueue *svq, size_t= num) uint32_t r =3D 0; =20 while (num--) { + g_autofree VirtQueueElement *elem =3D NULL; int64_t start_us =3D g_get_monotonic_time(); =20 do { @@ -541,7 +543,7 @@ size_t vhost_svq_poll(VhostShadowVirtqueue *svq, size_t= num) } } while (true); =20 - vhost_svq_get_buf(svq, &r); + elem =3D vhost_svq_get_buf(svq, &r); len +=3D r; } =20 --=20 2.44.0