From patchwork Tue Sep 12 08:42:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gavrilov Ilia X-Patchwork-Id: 138525 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp786943vqx; Tue, 12 Sep 2023 18:24:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHek3QtpTz6chgW6BFe9tfqu8mpu5EEqRg1UZkub6lS1ozI+zsnvaQpi6s5l3AFTT2jXKtO X-Received: by 2002:a05:6870:65a6:b0:1d5:e2f2:c7d with SMTP id fp38-20020a05687065a600b001d5e2f20c7dmr1289451oab.48.1694568265128; Tue, 12 Sep 2023 18:24:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694568265; cv=none; d=google.com; s=arc-20160816; b=IanBiEtDdL0S1rZ+dE4Gu2tRre/TAmmeYj4VXhkFYIkObA+RkSGXkn6vzH32WkXkyV SVrJoeCHqBjm0V2agSoelCr6Kf1QrF7u9AGTZrADgEcYsW6Acp68O5eOaTWK2gYIIqK8 u63hME/i3XnKw9+FH72uprEsUfMbH6nABJhjepr+1bSwNULuwrHcn0oP2HsJbEzLRv7H AhyuyVCx8X1namcl/yQNBwB6RW4rW5JuJ0BDE4/xkqGpKWYciqRRa3u3zFkz9kjRr171 jNbQziRtNePVy7f7+7AA980wVcAwkZUmHsuD6UqocbffhNvpZHrmqFrpQGAgapU8XWNv LNYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature:dkim-filter; bh=o5pd38GBTQwRmYAzeYxDd/4rQzPh+H8gE2oOiTG2l9k=; fh=lKd4sb+Jdcl5u8OaxppvM34J51CWXS8BRaNF+XgrJ5M=; b=e7Xn6eSSnj689YHVW4XNx3i5umMEtixPIkACuYinAEap0iIbBVdSlMX+tOmcOw8U7p NUEvSnPfoO+qfdpJn+pKs0REh5ymWt71HbZr+XCmYUJLIdwmhbcujxdRBaMLukKEn8ti IOJuT9GWZrdfAoMVDMp8PskJSlCzHqPZUbNJl1+ULLKoKqGyPX4ktRn/MQW2tqCk/1hq luz9cx9PqKkmERHpM1RqLYhnultPvgRoeyNUYFFH4SoTy0bWEdTx42X9ui+l1gfQA5TQ hSG79pLY3StUFx5QD4djv8zU07LUnHcmYlNwA+AUtHoVoCVLDijipBOxed1HcS/9TVc5 MsBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infotecs.ru header.s=mx header.b=Cx8QQNHt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=infotecs.ru Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id z16-20020a656650000000b0055c95e91f67si5787152pgv.155.2023.09.12.18.24.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 18:24:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@infotecs.ru header.s=mx header.b=Cx8QQNHt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=infotecs.ru Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 9C0078027B43; Tue, 12 Sep 2023 01:43:24 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233090AbjILInL (ORCPT + 38 others); Tue, 12 Sep 2023 04:43:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233180AbjILIm7 (ORCPT ); Tue, 12 Sep 2023 04:42:59 -0400 Received: from mx0.infotecs.ru (mx0.infotecs.ru [91.244.183.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6487A1FE9; Tue, 12 Sep 2023 01:42:38 -0700 (PDT) Received: from mx0.infotecs-nt (localhost [127.0.0.1]) by mx0.infotecs.ru (Postfix) with ESMTP id D5FF21024CF9; Tue, 12 Sep 2023 11:42:34 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx0.infotecs.ru D5FF21024CF9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=infotecs.ru; s=mx; t=1694508155; bh=o5pd38GBTQwRmYAzeYxDd/4rQzPh+H8gE2oOiTG2l9k=; h=From:To:CC:Subject:Date:From; b=Cx8QQNHtsV5ufknr8Tny5cX0espXouYTxrAA/U/jNubsYan+ZWF/zWiBe2WEVIM8P j1tXgqFheYUZsP6p3dJuw3TWQKF6Pd8m20PFSm+r345Ccj8a7y3a20g7ZXL314Fytu GW70IbIuOTaOhc7srW2JCLpoeuAztQSeZ5m7xk1o= Received: from msk-exch-01.infotecs-nt (msk-exch-01.infotecs-nt [10.0.7.191]) by mx0.infotecs-nt (Postfix) with ESMTP id D2EB53000095; Tue, 12 Sep 2023 11:42:34 +0300 (MSK) From: Gavrilov Ilia To: "David S. Miller" CC: David Ahern , Eric Dumazet , Jakub Kicinski , Paolo Abeni , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "lvc-project@linuxtesting.org" Subject: [PATCH net-next] ipv4: igmp: Remove redundant comparison in igmp_mcf_get_next() Thread-Topic: [PATCH net-next] ipv4: igmp: Remove redundant comparison in igmp_mcf_get_next() Thread-Index: AQHZ5VUTNq1uzE92eEGQ9QqcA3I0wA== Date: Tue, 12 Sep 2023 08:42:34 +0000 Message-ID: <20230912084039.1501984-1-Ilia.Gavrilov@infotecs.ru> Accept-Language: ru-RU, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.17.0.10] x-exclaimer-md-config: 208ac3cd-1ed4-4982-a353-bdefac89ac0a MIME-Version: 1.0 X-KLMS-Rule-ID: 5 X-KLMS-Message-Action: clean X-KLMS-AntiSpam-Status: not scanned, disabled by settings X-KLMS-AntiSpam-Interceptor-Info: not scanned X-KLMS-AntiPhishing: Clean, bases: 2023/09/12 07:28:00 X-KLMS-AntiVirus: Kaspersky Security for Linux Mail Server, version 8.0.3.30, bases: 2023/09/12 03:38:00 #21880520 X-KLMS-AntiVirus-Status: Clean, skipped Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Tue, 12 Sep 2023 01:43:24 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776847959672945298 X-GMAIL-MSGID: 1776883613162484052 The 'state->im' value will always be non-zero after the 'while' statement, so the check can be removed. Found by InfoTeCS on behalf of Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Gavrilov Ilia --- Repost according to https://lore.kernel.org/all/fea6db56-3a01-b7c8-b800-a6c885e99feb@kernel.org/ net/ipv4/igmp.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index 418e5fb58fd3..76c3ea75b8dd 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c @@ -2944,8 +2944,6 @@ static struct ip_sf_list *igmp_mcf_get_next(struct seq_file *seq, struct ip_sf_l continue; state->im = rcu_dereference(state->idev->mc_list); } - if (!state->im) - break; spin_lock_bh(&state->im->lock); psf = state->im->sources; }