From nobody Wed Apr 24 22:22:39 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=huawei.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1623331397903889.153896452998; Thu, 10 Jun 2021 06:23:17 -0700 (PDT) Received: from localhost ([::1]:54572 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrKeS-00055j-Su for importer2@patchew.org; Thu, 10 Jun 2021 09:23:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44380) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrKci-0002Pq-07 for qemu-devel@nongnu.org; Thu, 10 Jun 2021 09:21:28 -0400 Received: from szxga03-in.huawei.com ([45.249.212.189]:2177) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrKcf-0004Ei-Fg for qemu-devel@nongnu.org; Thu, 10 Jun 2021 09:21:27 -0400 Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.53]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4G14Jl3PPkz6wFQ; Thu, 10 Jun 2021 21:17:27 +0800 (CST) Received: from dggema765-chm.china.huawei.com (10.1.198.207) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Thu, 10 Jun 2021 21:21:20 +0800 Received: from localhost.localdomain (10.175.101.6) by dggema765-chm.china.huawei.com (10.1.198.207) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Thu, 10 Jun 2021 21:21:19 +0800 From: Peng Liang To: Subject: [PATCH] runstate: Initialize Error * to NULL Date: Thu, 10 Jun 2021 21:17:29 +0800 Message-ID: <20210610131729.3906565-1-liangpeng10@huawei.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.175.101.6] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggema765-chm.china.huawei.com (10.1.198.207) X-CFilter-Loop: Reflected 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=45.249.212.189; envelope-from=liangpeng10@huawei.com; helo=szxga03-in.huawei.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: philmd@redhat.com, alejandro.j.jimenez@oracle.com, laurent@vivier.eu, xiexiangyou@huawei.com, armbru@redhat.com, liangpeng10@huawei.com, pbonzini@redhat.com, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Based on the description of error_setg(), the local variable err in qemu_init_subsystems() should be initialized to NULL. Fix: efd7ab22fb "vl: extract qemu_init_subsystems" Signed-off-by: Peng Liang Reviewed-by: Daniel P. Berrang=C3=A9 --- The patch is generated by the following coccinelle script (thanks to Markus): @ r @ identifier id; @@ ( static Error *id; | Error *id + =3D NULL ; ) And exclude the modifications in softmmu/vl.c (which has fixed by Zhenzhong Duan already) and util/error.c (which are unnecessary). softmmu/runstate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/softmmu/runstate.c b/softmmu/runstate.c index ce8977c6a29c..54713100c2ea 100644 --- a/softmmu/runstate.c +++ b/softmmu/runstate.c @@ -746,7 +746,7 @@ static void qemu_run_exit_notifiers(void) =20 void qemu_init_subsystems(void) { - Error *err; + Error *err =3D NULL; =20 os_set_line_buffering(); =20 --=20 2.31.1