mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
To: Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>
Cc: linux-kernel@vger.kernel.org, Vladimir Zapolskiy <vz@mleia.com>,
	Zeng Heng <zengheng4@huawei.com>
Subject: [PATCH 0/2] regulator/core: A quick fix for struct device handling
Date: Sun, 17 Sep 2023 23:35:13 +0200	[thread overview]
Message-ID: <cover.1694985959.git.mirq-linux@rere.qmqm.pl> (raw)

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


             reply	other threads:[~2023-09-17 21:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-17 21:35 Michał Mirosław [this message]
2023-09-17 21:35 ` [PATCH 1/2] regulator/core: regulator_register: set device->class earlier Michał Mirosław
2023-09-17 21:35 ` [PATCH 2/2] Revert "regulator: core: fix kobject release warning and memory leak in regulator_register()" Michał Mirosław
2023-09-18 12:05   ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1694985959.git.mirq-linux@rere.qmqm.pl \
    --to=mirq-linux@rere.qmqm.pl \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vz@mleia.com \
    --cc=zengheng4@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®