From patchwork Fri Nov 18 01:12:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yue Haibing X-Patchwork-Id: 22019 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp717768wrr; Thu, 17 Nov 2022 17:20:12 -0800 (PST) X-Google-Smtp-Source: AA0mqf4WIBx8w5b+gxKFPV5CA9h0y35qKIlX2LrJBHpXU1o7YlD0gburnDrWJP/11e0EsceJIFTQ X-Received: by 2002:a05:6a00:2da:b0:56c:6f58:5937 with SMTP id b26-20020a056a0002da00b0056c6f585937mr5721137pft.5.1668734411793; Thu, 17 Nov 2022 17:20:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668734411; cv=none; d=google.com; s=arc-20160816; b=SXBx46MSdzpRY+1UcTNXylK+F46RQ4HcohanfBe8h/0CxiBUMfOzA49MHaJ29B+6hm DoARcbA7xGl8s57siCDjRgnAeDDen0dDSWhlBPXFH8Nlt/bPNtieljW/2zqemObIA4oF 8ggEKKBfdThj2H3MGFs5R7ZpnAyI1eKBvgonr1QX3sYGyCjdvp3mtqyMJFgw39sFJGYN V8agNZ3SqmSyLJ7OnVD+RJ7P5tOhBBdafaRmTa/DU1G5BOTqtOf4R/7LSx337zIRQ6aj vpS1bzvIkpb9qikMtHi2y0T7hTY0779fzdW7QC9ACxwvTMJcXoO+R11G15fpBniCteH9 +QPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=fQFf6sw1nLIOMXDwT14UzL6ivvXFTxMk4XGYVCrYQ9s=; b=S32bK6VgiUGjaionPLkXmBwoAP0jCZPVZXc0a69CKsyBkIRbzFzaaV4R7vPCvaB5ho y/imjijiqXJecn2oRjva81zu7NExHiVfQK+NCT2sThtQImqbD6BVZ0erG4+m8v/xSvjp aQquBQKHbOnq4KZNEJj7qfdSStadcB2UlMJGCUJNpz4Q+8Uo6Ge0iCSnakFriFTsXwWF ZwkSqg2dAdMm8tLnS15rBb46XynxXGZ4NRszAc0diK8Fbvb+SpJuK37cqKtSWlsXUKHS se0UdXAJxhZeeNG0lhSswssnQsZb1p4i+DslXztGBtVFuAt8QHv7yxwekZXxbBQXSshN I9iA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q185-20020a632ac2000000b00450200a1078si2194409pgq.853.2022.11.17.17.19.55; Thu, 17 Nov 2022 17:20:11 -0800 (PST) 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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240939AbiKRBNe (ORCPT + 99 others); Thu, 17 Nov 2022 20:13:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240955AbiKRBM4 (ORCPT ); Thu, 17 Nov 2022 20:12:56 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3BBA87A64; Thu, 17 Nov 2022 17:12:54 -0800 (PST) Received: from canpemm500007.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4NCzKV5zbTzRpJ0; Fri, 18 Nov 2022 09:12:30 +0800 (CST) Received: from localhost (10.174.179.215) by canpemm500007.china.huawei.com (7.192.104.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 18 Nov 2022 09:12:52 +0800 From: YueHaibing To: , , , , CC: , , YueHaibing Subject: [PATCH] macsec: Fix invalid error code set Date: Fri, 18 Nov 2022 09:12:49 +0800 Message-ID: <20221118011249.48112-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 MIME-Version: 1.0 X-Originating-IP: [10.174.179.215] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To canpemm500007.china.huawei.com (7.192.104.62) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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?1749794855084624632?= X-GMAIL-MSGID: =?utf-8?q?1749794855084624632?= 'ret' is defined twice in macsec_changelink(), when it is set in macsec_is_offloaded case, it will be invalid before return. Fixes: 3cf3227a21d1 ("net: macsec: hardware offloading infrastructure") Signed-off-by: YueHaibing Reviewed-by: Saeed Mahameed Reviewed-by: Antoine Tenart --- drivers/net/macsec.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c index a7b46219bab7..d73b9d535b7a 100644 --- a/drivers/net/macsec.c +++ b/drivers/net/macsec.c @@ -3835,7 +3835,6 @@ static int macsec_changelink(struct net_device *dev, struct nlattr *tb[], if (macsec_is_offloaded(macsec)) { const struct macsec_ops *ops; struct macsec_context ctx; - int ret; ops = macsec_get_ops(netdev_priv(dev), &ctx); if (!ops) {