Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp178007pxa; Mon, 10 Aug 2020 23:16:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9Bt4yDY9UC94au/4a0qSa7vTIM7JldOlKP94wt2ZH8STdf96JsC0tl1EDwU39t8g/jy8r X-Received: by 2002:a17:906:a153:: with SMTP id bu19mr24307787ejb.142.1597126590026; Mon, 10 Aug 2020 23:16:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597126590; cv=none; d=google.com; s=arc-20160816; b=MuBepA8H1QgJ2YOv9/DG1yWmABU98gL1OoUHShuYanhETJ2iseoo+SRJLGdqp6UMfz TOL2pQ4cyW4QHvaXDqH2QbYF9WpRadO4BExb2LTC1BONBDHlnPv1mIpXYA+eKK0887wy H6m/YJOdId475VHt/ggJtkzrgghr7K0BVj7HqWJbQYIab5NAq4VEO1z42OwDFbhpa35/ M2Zr+SQeDEZ1RgtmbIElYEfwm43bZ5jropHjZh6MDiqo244m1HbNnR9qGmqvYaDdSSw1 v66G1ltlnmzdETLAmwiqRxdmWnZrEaSrBpNykO24Hn33o1T+p5TiOs0UXYG1JiCcfmyR O4Gw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=LRSYAmoLZaQXUjDKnwxaOORgslAwmzpXHfKtjDIvMdk=; b=M4iVU9xo6oKWfvlVX1Lqj1Xtn9IpzBx3nTCH4SauLcBsbcv7cqKLbXyg77afJaxGNq t9zpPVwZNfEdq32zeX0TWtVF1z/ylypmcLC/zcG+M/SnXoYYkGeljujtrlgDeOwalRj1 V2U7gxvrzWNlK63t1sp2BVXoW13vhSjPHNYVgRFAMjN0gUGJod/mNHLabK9Eqwq2ecQz ayFE7xBEEDVVhQflseX46voEWOMGCCW39U73N2EKy4fLu8wus4Vt6c92fnOq46Q/oufV SjIHWJpk7hG7bgoZr68lcJMbOElTn1QmRQfb001wrcUhIZcPLVERn2k1NdLS5rRn6U2M /oTA== 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 24si16376962edv.581.2020.08.10.23.16.06; Mon, 10 Aug 2020 23:16:30 -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 S1727794AbgHKGPR (ORCPT + 99 others); Tue, 11 Aug 2020 02:15:17 -0400 Received: from mleia.com ([178.79.152.223]:41242 "EHLO mail.mleia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726154AbgHKGPP (ORCPT ); Tue, 11 Aug 2020 02:15:15 -0400 Received: from mail.mleia.com (localhost [127.0.0.1]) by mail.mleia.com (Postfix) with ESMTP id C28C93FDBB3; Tue, 11 Aug 2020 06:15:13 +0000 (UTC) Subject: Re: [PATCH 5/7] regulator: plug of_node leak in regulator_register()'s error path To: =?UTF-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= , Dmitry Osipenko , Liam Girdwood , Mark Brown Cc: linux-kernel@vger.kernel.org References: From: Vladimir Zapolskiy Message-ID: Date: Tue, 11 Aug 2020 09:15:07 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-49551924 X-CRM114-CacheID: sfid-20200811_061513_819030_95435139 X-CRM114-Status: GOOD ( 10.54 ) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Michał, On 8/11/20 4:07 AM, Michał Mirosław wrote: > By calling device_initialize() earlier and noting that kfree(NULL) is > ok, we can save a bit of code in error handling and plug of_node leak. > Fixed commit already did part of the work. > > Cc: stable@vger.kernel.org > Fixes: 9177514ce349 ("regulator: fix memory leak on error path of regulator_register()") > Signed-off-by: Michał Mirosław thank you for the patch! I was worried about a potentially remaining of_node reference leak, but I was not able to reproduce it on practice without code fuzzing. The change looks valid and it's a nice simplification. Acked-by: Vladimir Zapolskiy -- Best wishes, Vladimir