Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp693837ybk; Sat, 9 May 2020 15:44:29 -0700 (PDT) X-Google-Smtp-Source: APiQypLKz4YlBqIT5eP734e0QUYhworG/xDx39byZTN8uQswxjewXry8Ma6FGChVSBLlSwvqFWRU X-Received: by 2002:a17:906:31d7:: with SMTP id f23mr7821476ejf.59.1589064269639; Sat, 09 May 2020 15:44:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589064269; cv=none; d=google.com; s=arc-20160816; b=fAimEFiGxc6PTzIztwKNqeOZfl3mK+zb0X3NjQhnrlZV2WpDtTBcg9bml1urJh5c1i uQEqWlV393piBEfTuZ1N/A9Pu6VarUf33jxoDI8BqBJEvcXqL5hBrtD2ck4Y1F16Br+a qh5DxWnhix0Brw77dVe7TGtRiEPqrmpT5AchE4LaNf0DwEwDJykgqU0yEfWijRyz9Smh P1RQ1wN5r7NVxPG0icf6l8Vka8BHWz155jEnb3YHwZgiNAYrW+qpSCcTqYdOmVNZOvfn SdolRzYtY/30XQ6GvTIAPwsSPwfUS1cFxp0SC1HoVDXEA8Ygy3cW0mKrvcloVjTMbeY4 rv5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=SGcuXTM+0KRufdM+kokJFPPxCWk62QC2fhDR/CrnxFY=; b=EKPdHhYf8bjAdjV/C2ihr4L4Hz/eqkWLe8tNXmqHqn5t3FDDWv5yklFQmWVeYk7Vtm bIis6o5bmxgEo2BeP6jNot6Gaw3weXRBDBsHLjKEjyDjv6mEIXwdDLP+kocH/MibIXU5 MkeR2bschVAtPH4/ZwJLPLdxriviAgMmQA6/idt7I1L1A51xY3XGf7cvyTTgqtaXc+9t NSmRN4oh8/4dHs1GtHI0Vw8mbh7NNa3JzhjYMvnMl8Q9pff6mkJJzoy1A4mppJtx2lcc YzYXz8ZkVcuKcdyCvzGcNuzISp2ewoN75My06TUr6S6Uk5r2Lyj27uyoSvfxwx9BlhHO g/gw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n13si3410625edq.352.2020.05.09.15.44.06; Sat, 09 May 2020 15:44:29 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728420AbgEIWmk (ORCPT + 99 others); Sat, 9 May 2020 18:42:40 -0400 Received: from smtprelay0083.hostedemail.com ([216.40.44.83]:48244 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726771AbgEIWmk (ORCPT ); Sat, 9 May 2020 18:42:40 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay05.hostedemail.com (Postfix) with ESMTP id 0436318029123; Sat, 9 May 2020 22:42:39 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,,RULES_HIT:41:355:379:599:966:968:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2196:2199:2393:2553:2559:2562:2692:2828:2895:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3871:3874:4250:4321:4385:4605:5007:7903:10004:10400:10848:10967:11026:11232:11473:11658:11914:12043:12296:12297:12438:12740:12895:13069:13311:13357:13439:13618:13894:13972:14096:14097:14659:14721:21080:21627:21740:21990:30054:30070:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: force24_16f61c6693f2a X-Filterd-Recvd-Size: 2622 Received: from XPS-9350.home (unknown [47.151.136.130]) (Authenticated sender: joe@perches.com) by omf13.hostedemail.com (Postfix) with ESMTPA; Sat, 9 May 2020 22:42:37 +0000 (UTC) Message-ID: Subject: Re: [PATCH] net/sonic: Fix some resource leaks in error handling paths From: Joe Perches To: Jakub Kicinski , Christophe JAILLET Cc: davem@davemloft.net, fthain@telegraphics.com.au, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Date: Sat, 09 May 2020 15:42:36 -0700 In-Reply-To: <20200509111321.51419b19@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> References: <20200508172557.218132-1-christophe.jaillet@wanadoo.fr> <20200508185402.41d9d068@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <50ef36cd-d095-9abe-26ea-d363d11ce521@wanadoo.fr> <20200509111321.51419b19@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.36.1-2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 2020-05-09 at 11:13 -0700, Jakub Kicinski wrote: > On Sat, 9 May 2020 18:47:08 +0200 Christophe JAILLET wrote: > > Le 09/05/2020 ? 03:54, Jakub Kicinski a ?crit : > > > On Fri, 8 May 2020 19:25:57 +0200 Christophe JAILLET wrote: > > > > @@ -527,8 +531,9 @@ static int mac_sonic_platform_remove(struct platform_device *pdev) > > > > struct sonic_local* lp = netdev_priv(dev); > > > > > > > > unregister_netdev(dev); > > > > - dma_free_coherent(lp->device, SIZEOF_SONIC_DESC * SONIC_BUS_SCALE(lp->dma_bitmode), > > > > - lp->descriptors, lp->descriptors_laddr); > > > > + dma_free_coherent(lp->device, > > > > + SIZEOF_SONIC_DESC * SONIC_BUS_SCALE(lp->dma_bitmode), > > > > + lp->descriptors, lp->descriptors_laddr); > > > > free_netdev(dev); > > > > > > > > return 0; > > > This is a white-space only change, right? Since this is a fix we should > > > avoid making cleanups which are not strictly necessary. > > > > Right. > > > > The reason of this clean-up is that I wanted to avoid a checkpatch > > warning with the proposed patch and I felt that having the same layout > > in the error handling path of the probe function and in the remove > > function was clearer. > > So I updated also the remove function. > > I understand the motivation is good. David, maybe I missed some notification about Jakub's role. What is Jakub's role in relation to the networking tree?