From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DEBAACD37B4 for ; Sun, 17 Sep 2023 21:40:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239331AbjIQVfo (ORCPT ); Sun, 17 Sep 2023 17:35:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232790AbjIQVfX (ORCPT ); Sun, 17 Sep 2023 17:35:23 -0400 Received: from rere.qmqm.pl (rere.qmqm.pl [91.227.64.183]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E283131 for ; Sun, 17 Sep 2023 14:35:17 -0700 (PDT) Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 4Rph6T6vVHz62; Sun, 17 Sep 2023 23:35:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1694986514; bh=ZXKOuSqqrpe9gHfiZs/YFUPhkzcUcHYoH9le5k5Brg0=; h=Date:Subject:From:To:Cc:From; b=CiifftBrNTE4JluaAJIPMFmQhNAxHryOvCcqDE4PsE6qRjIOlGdOAdSz4ZDAwnhJJ p0s/wyI3WoFig9i/RlZw92+YrWiYyt/d9GvNbqCT/Cb9UrRPErbY6Qg3Wx/+2o8Ahs vwZlk6hbjCeoWKYJQ17ekjas6hwrCPZGjmCTuJUTAyd0xwJO1yJfNRtNThU/Trzdex /e2RMzj1T8ISUXTSWP62RCfsAkZMsjDdWEpoza1ZUlX45bnFzu6ZiN21tbsNBa2axq MccqfqwtLheu4owkZj14WtzOBsZbDCnUBK1TUB3hgQ+JzaDLre97uSlyTdXkX7qIm9 eNtJdnH9d7fMw== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.8 at mail Date: Sun, 17 Sep 2023 23:35:13 +0200 Message-Id: Subject: [PATCH 0/2] regulator/core: A quick fix for struct device handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: =?UTF-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= To: Liam Girdwood , Mark Brown Cc: linux-kernel@vger.kernel.org, Vladimir Zapolskiy , Zeng Heng Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When fixing a memory leak in commit d3c731564e09 ("regulator: plug of_node leak in regulator_register()'s error path") it moved the device_initialize() call earlier, but did not move the dev->class initialization. The bug was spotted and fixed by reverting part of the commit (in commit 5f4b204b6b81 "regulator: core: fix kobject release warning and memory leak in regulator_register()") and introducing a different bug: now early error paths use kfree(dev) instead of put_device() for an already initialized struct device. This series fixes the original bug and reverts the problematic fix. Michał Mirosław (2): regulator/core: regulator_register: set device->class earlier Revert "regulator: core: fix kobject release warning and memory leak in regulator_register()" drivers/regulator/core.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) -- 2.39.2