Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2848107rwb; Thu, 17 Nov 2022 17:31:39 -0800 (PST) X-Google-Smtp-Source: AA0mqf7bT3r3VOhV9InAXqt6OkMSOg3R25IQ6SMUJkn1awchuMoWyBsjUmnEc16SfihmF0ZR+HxK X-Received: by 2002:a05:6402:707:b0:467:6035:285c with SMTP id w7-20020a056402070700b004676035285cmr4279220edx.386.1668735099417; Thu, 17 Nov 2022 17:31:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668735099; cv=none; d=google.com; s=arc-20160816; b=xjBLMgsDU+qjSO1yL9tv3ZVl0vY71fGGS4TuxawigokwgKwDZSgvgtwv+oyJ3p2ztm wCfNok+hH6fSc67juzD7W/1iDBBD/WXpDErsZuln+oLY3W5n8x8lVRgQmoUBkcbzI6Vj gka8uDfZoalpYpRF2bqp6M5TvGzY+3vZ4a0GIDKyYN3OsizocaQl0tqGJftj+/jmgFw0 gLPpIKlP/uIxahcZyY+WqIzhCAjFCyLynl/C5TTcMwliA/XL+jiFUyx92rBMdD9EyKuv mud5cjhFgncodimSZrqVaWTGCe3wWKTuF6KmNqe/FxigIF5NMLuX1jFtCtpdhG1lmlmP ZkGA== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jg16-20020a170907971000b0078db3f08a6bsi2033108ejc.720.2022.11.17.17.30.55; Thu, 17 Nov 2022 17:31:39 -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 + 91 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 Content-Type: text/plain 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 '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 --- 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) { -- 2.20.1