From patchwork Wed May 3 10:31:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gavrilov Ilia X-Patchwork-Id: 89702 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1233262vqo; Wed, 3 May 2023 03:58:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ45x9baHx6oJuTebif59C2qbIFePwcpsyl5HzeO6AyFONA1M0CimYaNk9UjcDVjo50bHcht X-Received: by 2002:a05:6a20:a19e:b0:f4:24e6:1065 with SMTP id r30-20020a056a20a19e00b000f424e61065mr18239950pzk.39.1683111509690; Wed, 03 May 2023 03:58:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683111509; cv=none; d=google.com; s=arc-20160816; b=azV66qcLXObMIkdKyWjnYFThFlRcZhgTAv/6lUb7ze2GRmeJLkKKeO7bDZKBTjnWlA aSLo6OpdvWobKNr0F8sQ+Umvgw25SGTlIx2cugXVNVxBMDgTqyGtaclJ6Ssv1G5r7VPj BR32y23V6jV1ESPveMcuK3NXQSkXI6f8anbs+Q5SJDJwZsqCCo6Fyq8RbIhcDGBy8oys bznZIV5+o4IpcLX6WPiqrZdaVPhMHZMYCMeedRk740BIPk7lTk7+Zs6KFHjs/gpQvpTZ cZfR/SHPy5i+h1zKd4ZUgoTj1hs2EimUviqHuBoIxd8NWKmzpcdcCMyDSW9dYCfYndkM cQPw== 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:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature :dkim-filter; bh=KWv390BkinmwwaXe96nBkFt4dpGvWr/qTiStRAKAVhA=; b=XkevZtBB5ZwBv302mhKYDQcLNT+wXs6eDn/4EqSvqvziwqa+Hqg5MICGEq1DkvuoXZ +dRLTyZgTKbRXvOiHeXei73uflRLY+2Eq23m6JhLKYgOU7hcy4g8sji4cs4VtW3ZXPBv Xtz1icyWCL7OspIG1+yYKDmUWf6VeMJnKLl15HELki9TkCIgRg4SezXCM+CrWngKzMPi JebqiazccJMsceIpahx0LtUBfyciVDtE0m/p/+Rg9j3t03R4GssawFwJwRuoKZDPKnLT QSPUqLXANorLHZwlaXY4L5/S2tDGVs2XoR2HSxysv6lwCc2a4wmJw3gBpqdOQ/bvc4e7 hcWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infotecs.ru header.s=mx header.b=dpafbq+b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s13-20020a65584d000000b0050301265ffcsi31816107pgr.471.2023.05.03.03.58.13; Wed, 03 May 2023 03:58:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infotecs.ru header.s=mx header.b=dpafbq+b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=infotecs.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230032AbjECKbZ (ORCPT + 99 others); Wed, 3 May 2023 06:31:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229734AbjECKbX (ORCPT ); Wed, 3 May 2023 06:31:23 -0400 Received: from mx0.infotecs.ru (mx0.infotecs.ru [91.244.183.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB3AC19A8; Wed, 3 May 2023 03:31:17 -0700 (PDT) Received: from mx0.infotecs-nt (localhost [127.0.0.1]) by mx0.infotecs.ru (Postfix) with ESMTP id 80BE4108C502; Wed, 3 May 2023 13:31:15 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx0.infotecs.ru 80BE4108C502 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=infotecs.ru; s=mx; t=1683109875; bh=KWv390BkinmwwaXe96nBkFt4dpGvWr/qTiStRAKAVhA=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=dpafbq+bhwwYhA/y/OAtDaHVigVH9ay9e74OwOcLJtfsPm1DNxHDuQUzGG05RYT0t 5+6Nazeye+n6Hwsputbg/8i2nbfFm0wXrQBLv/dedMvzr6CN8fwe40rs1WhKMKk7D2 A8zTVwbqmF+cVei3PnvviOMBr2fKv1hPZrxsBeew= Received: from msk-exch-01.infotecs-nt (msk-exch-01.infotecs-nt [10.0.7.191]) by mx0.infotecs-nt (Postfix) with ESMTP id 7909330A7C8F; Wed, 3 May 2023 13:31:15 +0300 (MSK) From: Gavrilov Ilia To: Marcelo Ricardo Leitner CC: Simon Horman , Neil Horman , Xin Long , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , "linux-sctp@vger.kernel.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "lvc-project@linuxtesting.org" Subject: [PATCH net v3] sctp: remove unncessary check in sctp_sched_set_sched() Thread-Topic: [PATCH net v3] sctp: remove unncessary check in sctp_sched_set_sched() Thread-Index: AQHZfapjObQbDNSxlkamyq2whi4gYQ== Date: Wed, 3 May 2023 10:31:14 +0000 Message-ID: <20230503103108.3977352-1-Ilia.Gavrilov@infotecs.ru> References: In-Reply-To: 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: 1 X-KLMS-Message-Action: clean X-KLMS-AntiSpam-Lua-Profiles: 177141 [May 03 2023] X-KLMS-AntiSpam-Version: 5.9.59.0 X-KLMS-AntiSpam-Envelope-From: Ilia.Gavrilov@infotecs.ru X-KLMS-AntiSpam-Rate: 0 X-KLMS-AntiSpam-Status: not_detected X-KLMS-AntiSpam-Method: none X-KLMS-AntiSpam-Auth: dkim=none X-KLMS-AntiSpam-Info: LuaCore: 510 510 bc345371020d3ce827abc4c710f5f0ecf15eaf2e, {Tracking_from_domain_doesnt_match_to}, 127.0.0.199:7.1.2;infotecs.ru:7.1.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1 X-MS-Exchange-Organization-SCL: -1 X-KLMS-AntiSpam-Interceptor-Info: scan successful X-KLMS-AntiPhishing: Clean, bases: 2023/05/03 08:22:00 X-KLMS-AntiVirus: Kaspersky Security for Linux Mail Server, version 8.0.3.30, bases: 2023/05/03 05:22:00 #21210527 X-KLMS-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764870334716779327?= X-GMAIL-MSGID: =?utf-8?q?1764870334716779327?= The value of the 'sched' parameter of the function 'sctp_sched_set_sched' is checked on the calling side, so the internal check can be removed Found by InfoTeCS on behalf of Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Ilia.Gavrilov --- V2: - Change the order of local variables - Specify the target tree in the subject V3: - Change description - Remove 'fixes' net/sctp/stream_sched.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/net/sctp/stream_sched.c b/net/sctp/stream_sched.c index 330067002deb..52d308bdb469 100644 --- a/net/sctp/stream_sched.c +++ b/net/sctp/stream_sched.c @@ -155,9 +155,6 @@ int sctp_sched_set_sched(struct sctp_association *asoc, if (old == n) return ret; - if (sched > SCTP_SS_MAX) - return -EINVAL; - if (old) sctp_sched_free_sched(&asoc->stream);