Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp278455pxj; Fri, 14 May 2021 03:17:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOsFTnx8JK/TIll180R2/DaYMyAvV2eq+Ib5FZQLTek6i2w+YDQk0bVhXxQ3Q8+ICJMvdv X-Received: by 2002:a05:6e02:1b06:: with SMTP id i6mr24609752ilv.139.1620987465513; Fri, 14 May 2021 03:17:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620987465; cv=none; d=google.com; s=arc-20160816; b=pi/Q0vOinM2SocaOyzC7TVtDaWj6O9O8/HRE/dVAg99sQEZNJUwhwihQMs5bZ8+bCV +BfXFXRZTkzCr3VNbfeuhYMlYKTB8h84UA2F3tJf07+bwipu6e9TrdaGrTsasQskq45Z Tc2VCybDslcHEWenLdpfIHHrqRt69LUQpdzWsirzE3wl1VSW8hzMw4KOHr3pw7Uv8Omq n5TAto1+hoF9aidSKlwWLsmUqFrrqgdIhFyEfQR40jGQVxzQtWPa40rnbWB5SAVF5lon mvykGMLuQnWerRgT88NHzs0jvhoOi47RaYUXoskgVUHMCneL9/DJC/BKEvwa6jiEmzax bEPQ== 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=8b5T3ynwVQN4nlCAA78qLEgU5/6haGIoGfdOr1f8ADs=; b=y8iF2HkGW8+pxVqm2aaProGZPt3zH3nReLs0siAKHAfu8WBpz0zODVpa4lwTednEGq o/g7Kg47evWrug21y9utewtlx0ZRj7PbGI6Fn4iVv5O5nN8flWBuKaPj3ifUcebXL7jP 2g4iMlkouOz/sybIrCEDkfwgqHKH+Cagf/K2+PP0YtIVG1pWKeof3Po8UqNeb/bXsCLb T7EeN3p5A8lXIWf3tLoucb+TS8k7j21R2iM98vnS8uQbtJAQW/zVwwbwrDmHanWwgnUe o+H4Fz2R4XXkap9DjTaNkQKYfT6axGQJBBbkZmrhKAIIp1mYslVAHPj6u4q8jSpos42V Pibw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d23si6201018jam.89.2021.05.14.03.17.33; Fri, 14 May 2021 03:17:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231481AbhENIZC (ORCPT + 99 others); Fri, 14 May 2021 04:25:02 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:2981 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229524AbhENIZA (ORCPT ); Fri, 14 May 2021 04:25:00 -0400 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4FhM1q42bczlbR6; Fri, 14 May 2021 16:21:35 +0800 (CST) Received: from ubuntu1804.huawei.com (10.67.174.98) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.498.0; Fri, 14 May 2021 16:23:37 +0800 From: Pu Lehui To: , , , CC: , , Subject: [PATCH net-next] alx: fix missing unlock on error in alx_set_pauseparam() Date: Fri, 14 May 2021 16:24:05 +0800 Message-ID: <20210514082405.91011-1-pulehui@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.174.98] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add the missing unlock before return from function alx_set_pauseparam() in the error handling case. Fixes: 4a5fe57e7751 ("alx: use fine-grained locking instead of RTNL") Signed-off-by: Pu Lehui --- drivers/net/ethernet/atheros/alx/ethtool.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/atheros/alx/ethtool.c b/drivers/net/ethernet/atheros/alx/ethtool.c index f3627157a38a..b716adacd815 100644 --- a/drivers/net/ethernet/atheros/alx/ethtool.c +++ b/drivers/net/ethernet/atheros/alx/ethtool.c @@ -253,8 +253,10 @@ static int alx_set_pauseparam(struct net_device *netdev, if (reconfig_phy) { err = alx_setup_speed_duplex(hw, hw->adv_cfg, fc); - if (err) + if (err) { + mutex_unlock(&alx->mtx); return err; + } } /* flow control on mac */ -- 2.17.1