From patchwork Sat Dec 3 09:41:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yongqiang Liu X-Patchwork-Id: 29249 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1290718wrr; Sat, 3 Dec 2022 01:54:10 -0800 (PST) X-Google-Smtp-Source: AA0mqf61GhWdkics6yM4R2CsuV145UMMGmLJh2cguiIJCl+cnk+budx92u7kP5uQLieriwuQKU61 X-Received: by 2002:a62:605:0:b0:574:ec7f:20d0 with SMTP id 5-20020a620605000000b00574ec7f20d0mr34469836pfg.77.1670061250159; Sat, 03 Dec 2022 01:54:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670061250; cv=none; d=google.com; s=arc-20160816; b=VOwaTXyyGBWVESnruvEDDiUVlusaF9Eiz0SxJJs89Gamx7MvRlP0EycUc1rDCqbM73 Rdz5RYERFWs8QPJr2/z2R/Qp3F5OnA3a6TK3P2qo6cJ/OoycAUNi+TlHusN7RsPEspMs FEZ0Aaxu0tcaA2DlPLg31Idwxp6JfBFsvP1IKFs/R28NDBV4kqj29NA1F5erf8fo03Sx Wz8oNvNQW/Qc2Idfp48zGVLbq8+RAsIS8DmTmz/qfvShJHmrqSii++wQtqsc1IJ1kA0P 0OZ4VmlKVmItsRvv3jusMDIETnwzE/0aRLgn9fPyczbjc6VGpuMFCtGj58fUwmuIauia OpKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=5CrIK01ePR6bG75po5mX9WaC/xCPz8c2AmooxJM1sAk=; b=UXxhm/Hx5n96+H27iWJTHKAyEJN4wBXbh9z7PO37aXnWJ4H3Jv8xG7oVRg44rAvXaw J3yqrhM/fg1pDj+v/4686mPdQjJsR2q/apPYI8Vhk8DlnG9lOtvBrMCm+k7cCxujsiaD sLINgHfq0PdqBKkrACS2A17tzXx86RPM3Lwmyutjqlu75mTSm+ly2e+dkH+AiAAWjh4G xcWsTj0dOt0Eg9a/mxWcPfIeqbGR13pBY0afr7IPaqm02L5X8wvhzpf0/6BC/UdI4LJ0 aExhZg0Y4B+NpYXsQ1jotjhNPBvXWp+UJxWhq65j7WyI94MmmFsZ9981pATgioRw7FRB HJgg== 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 r13-20020a63d90d000000b00476e11d6938si9310008pgg.325.2022.12.03.01.53.56; Sat, 03 Dec 2022 01:54:10 -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 S229548AbiLCJlh (ORCPT + 99 others); Sat, 3 Dec 2022 04:41:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229476AbiLCJlf (ORCPT ); Sat, 3 Dec 2022 04:41:35 -0500 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4422537C3; Sat, 3 Dec 2022 01:41:34 -0800 (PST) Received: from dggpeml500005.china.huawei.com (unknown [172.30.72.57]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4NPPv53dn1z15Lxj; Sat, 3 Dec 2022 17:40:49 +0800 (CST) Received: from huawei.com (10.175.112.125) by dggpeml500005.china.huawei.com (7.185.36.59) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Sat, 3 Dec 2022 17:41:32 +0800 From: Yongqiang Liu To: , , CC: , , , , , , , , Subject: [PATCH] net: thunderx: Fix missing destroy_workqueue of nicvf_rx_mode_wq Date: Sat, 3 Dec 2022 09:41:25 +0000 Message-ID: <20221203094125.602812-1-liuyongqiang13@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpeml500005.china.huawei.com (7.185.36.59) 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?1751186145644673408?= X-GMAIL-MSGID: =?utf-8?q?1751186145644673408?= The nicvf_probe() won't destroy workqueue when register_netdev() failed. Add destroy_workqueue err handle case to fix this issue. Fixes: 2ecbe4f4a027 ("net: thunderx: replace global nicvf_rx_mode_wq work queue for all VFs to private for each of them.") Signed-off-by: Yongqiang Liu Reviewed-by: Pavan Chebbi --- drivers/net/ethernet/cavium/thunder/nicvf_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_main.c b/drivers/net/ethernet/cavium/thunder/nicvf_main.c index 98f3dc460ca7..f2f95493ec89 100644 --- a/drivers/net/ethernet/cavium/thunder/nicvf_main.c +++ b/drivers/net/ethernet/cavium/thunder/nicvf_main.c @@ -2239,7 +2239,7 @@ static int nicvf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) err = register_netdev(netdev); if (err) { dev_err(dev, "Failed to register netdevice\n"); - goto err_unregister_interrupts; + goto err_destroy_workqueue; } nic->msg_enable = debug; @@ -2248,6 +2248,8 @@ static int nicvf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) return 0; +err_destroy_workqueue: + destroy_workqueue(nic->nicvf_rx_mode_wq); err_unregister_interrupts: nicvf_unregister_interrupts(nic); err_free_netdev: