Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp6190148rwl; Thu, 29 Dec 2022 08:46:18 -0800 (PST) X-Google-Smtp-Source: AMrXdXvJFC8fHCnpZdFKzJsDv9xG4yOVZ7HgikZO0lHFPmvTYDZipCTAmColFpyXPBduzk8WXnNr X-Received: by 2002:a62:198c:0:b0:57f:ef24:5829 with SMTP id 134-20020a62198c000000b0057fef245829mr28360461pfz.17.1672332378650; Thu, 29 Dec 2022 08:46:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672332378; cv=none; d=google.com; s=arc-20160816; b=YYrNhw6I5IvQzu+lsQWSHE9mOjOVyrqm+SYtYNUkCvNOB/nz5E3gSY8J/56F2sxaDf yiaL1xNfBFi+LUNCc+JXgRtbAHpAzreDjBczfRrhmSl0a9ALdqQEF43nSpjO/j+ebv/F PTTQQ+kK7Sn7NKPaAYpjO6JY8lRs8EnphkJmUyhkslDegxHmY7k8YPAf/Hzlsw/NFCLy 5Sup4l34qunDxOV153t0CcpD3Who/R4ovd/b6lfF5sOYEm+CPRpyRqswB4r868o32qwC 4YnHCLAQcFbjD6+Xeo5E/yyWxoXZ08umJsZU6TNer9VZvd/rrHS2DJxlGv62+prlPdEl wI2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id; bh=k0KRGPZoIK099M+BUgkWj68n7CYlR9UjxB0WIk1LRoA=; b=fqsgRGBvSM1i/3aP/fPE/7fhj5LS2YK8qOy+8NcgrX3TT+wBxlJhPhJLzdVX3ZY3/z euufkAxTAG/lXNVEAmPiBvBIHy2qS1Xt/iSE88mAkg2gr4X5e6cOjqDh5sS+QA/WywX8 /m4tX1zms0i1r42yQ4MBfBfDw7XQlDrLbrQXXHu8ZjDntqeLwB89TU4bKEyy6xMZJJeW f5q8x1ThF0hvCLGV1nMxley0TWF5gxixFC6WYdgfFsQFsq4TrAj0naSLwGbm4tDKBN3M MWZ9Uoar/zXqb1aNg+8Tc/fOFrtiawqTDf+kALKrOC+dCpgBHVUw4UIWlVykhEtRazpL hsLQ== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y5-20020a056a00190500b00578b212e4e5si20510906pfi.74.2022.12.29.08.46.10; Thu, 29 Dec 2022 08:46:18 -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 S233613AbiL2Qeb (ORCPT + 61 others); Thu, 29 Dec 2022 11:34:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229735AbiL2Qe3 (ORCPT ); Thu, 29 Dec 2022 11:34:29 -0500 Received: from smtp.smtpout.orange.fr (smtp-26.smtpout.orange.fr [80.12.242.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8905D11A32 for ; Thu, 29 Dec 2022 08:34:27 -0800 (PST) Received: from [192.168.1.18] ([86.243.100.34]) by smtp.orange.fr with ESMTPA id AvrKpnmhptht4AvrKpvTPn; Thu, 29 Dec 2022 17:34:25 +0100 X-ME-Helo: [192.168.1.18] X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Thu, 29 Dec 2022 17:34:25 +0100 X-ME-IP: 86.243.100.34 Message-ID: <437145bf-d925-e91e-affd-835d272c55a0@wanadoo.fr> Date: Thu, 29 Dec 2022 17:34:22 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH net] fjes: Fix an error handling path in fjes_probe() To: Michal Swiatkowski Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Taku Izumi , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, netdev@vger.kernel.org References: Content-Language: fr, en-US From: Christophe JAILLET In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, SPF_PASS autolearn=unavailable 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 Le 21/12/2022 à 10:59, Michal Swiatkowski a écrit : > On Tue, Dec 20, 2022 at 09:57:06PM +0100, Christophe JAILLET wrote: >> 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 >> --- >> 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: > > Reviewed-by: Michal Swiatkowski > > I wonder if it won't be better to have fjes_sw_deinit() instead or > change fjes_sw_init to only netif_napi_add(). You know, to avoid another > bug here when someone add sth to the fjes_sw_deinit(). This is only > suggestion, patch looks fine. hi, based on Jakub's comment [1], free_netdev() already cleans up NAPIs (see [2]). So would it make more sense to remove netif_napi_del() from the .remove() function instead? The call looks useless to me now. CJ [1]: https://lore.kernel.org/all/20221221174043.1191996a@kernel.org/ [2]: https://elixir.bootlin.com/linux/v6.2-rc1/source/net/core/dev.c#L10710 > >> -- >> 2.34.1 >> >