From patchwork Fri Jul 31 05:06:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lukas Straub X-Patchwork-Id: 11694097 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 16880138C for ; Fri, 31 Jul 2020 05:08:54 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 84D8D20829 for ; Fri, 31 Jul 2020 05:08:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=web.de header.i=@web.de header.b="ZuzxNXED" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 84D8D20829 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=web.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:40696 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k1NHo-0002iC-6R for patchwork-qemu-devel@patchwork.kernel.org; Fri, 31 Jul 2020 01:08:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49582) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k1NFc-0002BL-14 for qemu-devel@nongnu.org; Fri, 31 Jul 2020 01:06:36 -0400 Received: from mout.web.de ([212.227.17.11]:42735) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k1NFa-0005zC-4q for qemu-devel@nongnu.org; Fri, 31 Jul 2020 01:06:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1596171981; bh=+HpgZT0db2KwCA/cG8ID80eu7YViB6cgJ/ExPSqDfQ4=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject; b=ZuzxNXEDDzPTqoIQnGtSi3NrS+jDWzf56wppOapVRRNeDM8LDQdXr805QQYBwSAHb DantqPAgZARs8DQTAxnlwcOqi+ruuX3stLscKsfuZqX23G372MDosggARu0njPYPvO ti0gQVHWgN+O7df3W/6V0PIFs/K/5jYx/k82vTf0= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from luklap ([88.130.61.42]) by smtp.web.de (mrweb105 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MoecF-1kXx3M1g8f-00ogxM; Fri, 31 Jul 2020 07:06:21 +0200 Date: Fri, 31 Jul 2020 07:06:04 +0200 From: Lukas Straub To: qemu-devel Subject: [PATCH] colo-compare: Remove superfluous NULL-pointer checks for s->iothread Message-ID: <20200731070604.0c981f41@luklap> MIME-Version: 1.0 X-Provags-ID: V03:K1:cCLqMmN0rGoBjfJsVABXnmzYwbaioEBwfSp41Vk/OJsUED3TRAZ pC1MUWo+L+IE2Hg9tRU7zJ1HMws4D8wLiUypM8YoEv55D4u6nKu5rmGtdrl4HWr1KMVkGwh wTGZ/hCi2J3QincuYU4mbVq1FNA64ePUWSSv4Foj71kLi3Iz06Q1VYJb4AsxdJrhbo/PXTJ BRSd2UuL+4v3hnJWf22kw== X-UI-Out-Filterresults: notjunk:1;V03:K0:gCQBrjvsl8g=:z8mH4c7VQgYEQltfmLfAU0 xD1XOVeb6NP7YN2ZsQ7BzQWg0OMlJlX16+wnBkFjh4XQAEFwXADobMlPY+1moj/RuSCNq6Hv4 s3PlA9FDyDFzRoPvpenzIbk55fzwHL1dYyfL3getWu9VqBPBbe9gdv+gGMRhXD/WQjlTAiQ5u RnMHa4V9nZYS6qPFQ/LEvC0NCOKk/dFSt7aoIGv4cOFK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LB/QWYSNF3wg== Received-SPF: pass client-ip=212.227.17.11; envelope-from=lukasstraub2@web.de; helo=mout.web.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/31 01:06:31 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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: Peter Maydell , Jason Wang , Zhang Chen Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" s->iothread is checked for NULL on object creation in colo_compare_complete, so it's guaranteed not to be NULL. This resolves a false alert from Coverity (CID 1429969). Signed-off-by: Lukas Straub Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Li Qiang Reviewed-by: Zhang Chen --- net/colo-compare.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/net/colo-compare.c b/net/colo-compare.c index cc15f23dea..2c20de1537 100644 --- a/net/colo-compare.c +++ b/net/colo-compare.c @@ -1442,9 +1442,7 @@ static void colo_compare_finalize(Object *obj) qemu_chr_fe_deinit(&s->chr_notify_dev, false); } - if (s->iothread) { - colo_compare_timer_del(s); - } + colo_compare_timer_del(s); qemu_bh_delete(s->event_bh); @@ -1470,9 +1468,7 @@ static void colo_compare_finalize(Object *obj) g_hash_table_destroy(s->connection_track_table); } - if (s->iothread) { - object_unref(OBJECT(s->iothread)); - } + object_unref(OBJECT(s->iothread)); g_free(s->pri_indev); g_free(s->sec_indev);