Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp523771ybk; Sat, 9 May 2020 09:49:30 -0700 (PDT) X-Google-Smtp-Source: APiQypKw7DXY5CGSDqE3Og5d5dfDIXMfozxxMiy7O3oFgFHRUFKTLg4CDujk6GOH3El/Y/KWK282 X-Received: by 2002:aa7:d1cc:: with SMTP id g12mr7018407edp.84.1589042969947; Sat, 09 May 2020 09:49:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589042969; cv=none; d=google.com; s=arc-20160816; b=jf0lAozATY6XkCKTeuyucA1TUp4UbNCj1tbTbR9t/8MhaRlJYLOxAyJ4MS7sZKhke7 xvqUHL/KpePCkIMd2OagSU+wZliAAodFOwfijfPTa4ppwJLxceOc5s3X7i8aku2sDw46 x7g8zG2cT9pj1uwJwIpq8+/DU2tPSbuyBobIDFwLuydpD2v6VVjR/xLHpl+vR2DrNl7g uRF0dGgHdtHYSR3xjK3Frac/DGaoUi80M0Q1zR9xTRNSLpOURR5w7FHZX+Rpml2WK3/m Pot6yrPJebedTNS1iqBOEdJekZcAsKfQUqSrjaUH4CqWitz7EbymegmucaaGHqNHlBZZ pjeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=6rgdIgP6BCYr5nQ7SRTjHxFVSl3Wxx+WV4uSe9CdOfU=; b=LuQGrxRofVGKuKAaJdxYO6vhS1fEEgOrCrP/yWBIRAZx3VGIErzLOWIi3eZxPoo6Sr qyuax6Zwo8BZMpWOQskx3p3MpQlldfAaUxZePP3sg+Z28x1HoGzcK9oyJg5vt6wdX8Mp n6h3j08Xqrvri5RajYyjFauT6KBC+xW5i6V0kC1tX0h54Ynd9u6u0b06xqvAyEr9NJAm E6AUVN3hvKbBaaau4OkfDUWiYswO+vcXjOHh9wMJW/ve0vW2RFZEo/fbzQO4ex8Pva7O V0jOqu3QCHIIiTBfYMO77fA6UaNFdA9eX9gvSfO4XzRBcMiItI9Y4s6nirQLzDiIhSoj UsMQ== 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 d9si1408072ejy.431.2020.05.09.09.49.06; Sat, 09 May 2020 09:49: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 S1728371AbgEIQrS (ORCPT + 99 others); Sat, 9 May 2020 12:47:18 -0400 Received: from smtp06.smtpout.orange.fr ([80.12.242.128]:27301 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727993AbgEIQrS (ORCPT ); Sat, 9 May 2020 12:47:18 -0400 Received: from [192.168.42.210] ([93.22.151.218]) by mwinf5d41 with ME id cgn9220054iyQ5p03gn9Tp; Sat, 09 May 2020 18:47:16 +0200 X-ME-Helo: [192.168.42.210] X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sat, 09 May 2020 18:47:16 +0200 X-ME-IP: 93.22.151.218 Subject: Re: [PATCH] net/sonic: Fix some resource leaks in error handling paths To: Jakub Kicinski Cc: davem@davemloft.net, fthain@telegraphics.com.au, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org References: <20200508172557.218132-1-christophe.jaillet@wanadoo.fr> <20200508185402.41d9d068@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> From: Christophe JAILLET Message-ID: <50ef36cd-d095-9abe-26ea-d363d11ce521@wanadoo.fr> Date: Sat, 9 May 2020 18:47:08 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200508185402.41d9d068@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Fell free to ignore this hunk if not desired. I will not sent a V2 only for that. CJ