From patchwork Tue Dec 20 20:57:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 35193 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp3177749wrn; Tue, 20 Dec 2022 13:00:15 -0800 (PST) X-Google-Smtp-Source: AA0mqf5lHwX3BB5hUipsOnaPEeMrbH7hJsB6xIS4pQn02O782J1sE0RicPw0e96paSh6llhEhWGC X-Received: by 2002:a17:907:6d96:b0:7c1:7442:8b77 with SMTP id sb22-20020a1709076d9600b007c174428b77mr37657743ejc.5.1671570015304; Tue, 20 Dec 2022 13:00:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671570015; cv=none; d=google.com; s=arc-20160816; b=xIoECcUh0OHT7q2PKMm/d7/7JSBFNHS22CbzLROJMmDfZkVGg1ZKKJwX13J6HIwULJ paJasUa/Mjbx4w9km9M2teNHlpRXIIurggIx4ktl7YbK3TvtWjF1m4PRj9/mURQONIIS Gu9nVompsaPcPxs9IE44Ri5J82FAxKszuIJt5+9ceKL/h8PEyqrdtsXjIYHFjx6KSdXy S+WaZ3vWPHMqjtPlC8wAt8phjaaHVhFmPDMljHrYU7JsnDlsPPuc4rHKm1upk2JVszTT HKtjGsRfzuVxm3NNM5iApEC8JgKW1jdtdLX4/Jp4GqW7g4vWH0rFkdi7Gjw1OPkn0kco c95A== 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=L5o94Pkhs8E3vT6Y1sb4BP5bXhCoj/siC/LlkaDTSE8=; b=xDjRpxIXRSU5PkX4RlZXhEpjnIxcf6ifKcTB1rWYIEQXW4EiguP0Vd+6MEdDbl0Wzt iy9SIgQ2qPz1kibfYW3psEnPp8SKGLdTax1IvXZDb5Rq63rDmS/Lk4QZCa/bwb1LIL3M QxPOeKggjjO80WG4MTj3TqdTi+mrFMJBzvhd8g6PID3Qq9pSj53QF5MHD38tPmGQXIch JmYX1QX8MpWYN/Yhpe5HNRwtcPPmTnP8PtcVqu+LLYIx7fwFUslHBw3TjTZ1igVUj/bq 41lZuu31S4ucx5XVibL3PZhLMKa7CRg+A5ecZfeqM8eWju1p5Kx74UQRfBxfNrRqfrfl IF7A== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h9-20020a05640250c900b0045c97cb9027si13838794edb.421.2022.12.20.12.59.51; Tue, 20 Dec 2022 13:00:15 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234331AbiLTU5U (ORCPT + 99 others); Tue, 20 Dec 2022 15:57:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234288AbiLTU5O (ORCPT ); Tue, 20 Dec 2022 15:57:14 -0500 Received: from smtp.smtpout.orange.fr (smtp-24.smtpout.orange.fr [80.12.242.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0AF2113DC8 for ; Tue, 20 Dec 2022 12:57:11 -0800 (PST) Received: from pop-os.home ([86.243.100.34]) by smtp.orange.fr with ESMTPA id 7jfgp6zGQPNsN7jfgpkyQP; Tue, 20 Dec 2022 21:57:09 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 20 Dec 2022 21:57:09 +0100 X-ME-IP: 86.243.100.34 From: Christophe JAILLET To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Taku Izumi Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , netdev@vger.kernel.org Subject: [PATCH net] fjes: Fix an error handling path in fjes_probe() Date: Tue, 20 Dec 2022 21:57:06 +0100 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,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?1752768200636344193?= X-GMAIL-MSGID: =?utf-8?q?1752768200636344193?= A netif_napi_add() call is hidden in fjes_sw_init(). It should be undone by a corresponding netif_napi_del() call in the error handling path of the probe, as already done inthe remove function. Fixes: 265859309a76 ("fjes: NAPI polling function") Signed-off-by: Christophe JAILLET Reviewed-by: Michal Swiatkowski --- drivers/net/fjes/fjes_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/fjes/fjes_main.c b/drivers/net/fjes/fjes_main.c index 2513be6d4e11..01b4c9c6adbd 100644 --- a/drivers/net/fjes/fjes_main.c +++ b/drivers/net/fjes/fjes_main.c @@ -1370,7 +1370,7 @@ static int fjes_probe(struct platform_device *plat_dev) adapter->txrx_wq = alloc_workqueue(DRV_NAME "/txrx", WQ_MEM_RECLAIM, 0); if (unlikely(!adapter->txrx_wq)) { err = -ENOMEM; - goto err_free_netdev; + goto err_del_napi; } adapter->control_wq = alloc_workqueue(DRV_NAME "/control", @@ -1431,6 +1431,8 @@ static int fjes_probe(struct platform_device *plat_dev) destroy_workqueue(adapter->control_wq); err_free_txrx_wq: destroy_workqueue(adapter->txrx_wq); +err_del_napi: + netif_napi_del(&adapter->napi); err_free_netdev: free_netdev(netdev); err_out: