From patchwork Mon May 17 08:57:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 12261221 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F23ADC433B4 for ; Mon, 17 May 2021 08:58:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D1EA3611BD for ; Mon, 17 May 2021 08:58:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235812AbhEQI73 (ORCPT ); Mon, 17 May 2021 04:59:29 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:54032 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235760AbhEQI72 (ORCPT ); Mon, 17 May 2021 04:59:28 -0400 Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 14H8mV6v031184; Mon, 17 May 2021 08:58:07 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2020-01-29; bh=NzpXTJModC0Ot0dVk1rnqM4xwhNeiQvKOw+8+A3BrMI=; b=oJwOC6Z0Fu3R0Lm2CkgtxisBEdXMeKekIMEMn+CjqpEM9Q16i1QgfhEwHPS515DEyR92 lkujNBLoq3tKtbJYpMzeck/RA4tfJcg4VmjuH8GTUZS2dQBmqnKEDuY6O+ZImQurlyRb bcV4iW7bc+E/du7dqElOZzp8bTqhPVsJ21ZjL1+AN/Va1j/gfMjQzLmYCQ6Mvivz+xhH hkTBbSDNucD7yjawqLCtK4bWQIKNFunMmFuSsQ2s3g1ot7UABs+uqwQHOpGWum5FKaOH 3kTacPofftEUYd5z189Nv8AeZOKsUzQvYA2tVBbS3xZjw4ci1TWV/XKyVMnaHe6+EDig 0Q== Received: from oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 38kfhwg3uj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 17 May 2021 08:58:06 +0000 Received: from aserp3020.oracle.com (aserp3020.oracle.com [127.0.0.1]) by pps.podrdrct (8.16.0.36/8.16.0.36) with SMTP id 14H8lq3O122591; Mon, 17 May 2021 08:58:06 GMT Received: from pps.reinject (localhost [127.0.0.1]) by aserp3020.oracle.com with ESMTP id 38j644tm1w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 17 May 2021 08:58:06 +0000 Received: from aserp3020.oracle.com (aserp3020.oracle.com [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 14H8w5Mm011605; Mon, 17 May 2021 08:58:05 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserp3020.oracle.com with ESMTP id 38j644tm0d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 17 May 2021 08:58:05 +0000 Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 14H8w3fd020047; Mon, 17 May 2021 08:58:03 GMT Received: from mwanda (/102.36.221.92) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 17 May 2021 01:58:02 -0700 Date: Mon, 17 May 2021 11:57:56 +0300 From: Dan Carpenter To: Chris Snook , Johannes Berg Cc: Zekun Shen , netdev@vger.kernel.org, kernel-janitors@vger.kernel.org, "David S. Miller" , Jakub Kicinski Subject: [PATCH 1/2 net-next] alx: fix a double unlock in alx_probe() Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-Proofpoint-GUID: HAcNKcM_uMKqIerWJ7Qjc9rn_GU74mKj X-Proofpoint-ORIG-GUID: HAcNKcM_uMKqIerWJ7Qjc9rn_GU74mKj Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org We're not holding the lock at this point so "goto unlock;" should be "goto unmap;" Fixes: 4a5fe57e7751 ("alx: use fine-grained locking instead of RTNL") Signed-off-by: Dan Carpenter --- drivers/net/ethernet/atheros/alx/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/atheros/alx/main.c b/drivers/net/ethernet/atheros/alx/main.c index e8884879a50f..45e380f3b065 100644 --- a/drivers/net/ethernet/atheros/alx/main.c +++ b/drivers/net/ethernet/atheros/alx/main.c @@ -1859,7 +1859,7 @@ static int alx_probe(struct pci_dev *pdev, const struct pci_device_id *ent) err = register_netdev(netdev); if (err) { dev_err(&pdev->dev, "register netdevice failed\n"); - goto out_unlock; + goto out_unmap; } netdev_info(netdev, From patchwork Mon May 17 08:58:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 12261223 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9135C433B4 for ; Mon, 17 May 2021 08:58:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9231161184 for ; Mon, 17 May 2021 08:58:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235816AbhEQJAH (ORCPT ); Mon, 17 May 2021 05:00:07 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:35628 "EHLO mx0a-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235510AbhEQJAG (ORCPT ); Mon, 17 May 2021 05:00:06 -0400 Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 14H8l004030473; Mon, 17 May 2021 08:58:47 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type : in-reply-to; s=corp-2020-01-29; bh=BmkRI2QJIX544Vr/gqGTFLcETOY1snYLn3dIrLvTSXs=; b=MUhrRwxhMqFc+7h3pfGd5i5bhKX00OPvJ9YcO42wu2aLRPdgUetRvxPxPMjQJsJa0J8M dX/2sNNtkN0vAgg1RSj4WMHY049S3CxRsWFX1xXp8MmN86nKKRt/NZhPOaY96YMc88K7 JHilgVeUGjMtvvi1UWM4uS5t53sEDs/o2JUAnTQHBLbeStT/OV8hejDkzVr9CKOLhJ/O Di2HIBuNzdGrlOwNve1pp4eLS0TcnSSj3n/Jt2AHX8pSs34h2KeRxZviKICoVxYJ0lJ/ ZGibK/po/q/QNiT4rtbEIDNxT/6pWmhLqixcdlOQ0XYE9qOINNPSiNQW5Os+w5Q51n7x Qg== Received: from oracle.com (aserp3030.oracle.com [141.146.126.71]) by mx0b-00069f02.pphosted.com with ESMTP id 38j6usgmwa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 17 May 2021 08:58:46 +0000 Received: from aserp3030.oracle.com (aserp3030.oracle.com [127.0.0.1]) by pps.podrdrct (8.16.0.36/8.16.0.36) with SMTP id 14H8pwH0066457; Mon, 17 May 2021 08:58:45 GMT Received: from pps.reinject (localhost [127.0.0.1]) by aserp3030.oracle.com with ESMTP id 38j4baytvb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 17 May 2021 08:58:45 +0000 Received: from aserp3030.oracle.com (aserp3030.oracle.com [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 14H8suq9070534; Mon, 17 May 2021 08:58:45 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3030.oracle.com with ESMTP id 38j4baytv8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 17 May 2021 08:58:45 +0000 Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 14H8wi7B009528; Mon, 17 May 2021 08:58:44 GMT Received: from mwanda (/102.36.221.92) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 17 May 2021 08:58:44 +0000 Date: Mon, 17 May 2021 11:58:37 +0300 From: Dan Carpenter To: Chris Snook Cc: "David S. Miller" , Jakub Kicinski , Johannes Berg , netdev@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH 2/2 net-next] alx: unlock on error in alx_set_pauseparam() Message-ID: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email haha only kidding X-Proofpoint-GUID: _hlPJYDV7W9bnr2QOeY3AUvyoDj_picS X-Proofpoint-ORIG-GUID: _hlPJYDV7W9bnr2QOeY3AUvyoDj_picS Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org We need to drop the lock before returning on this error path. Fixes: 4a5fe57e7751 ("alx: use fine-grained locking instead of RTNL") Signed-off-by: Dan Carpenter --- 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 */