From: Lee Jones <lee@kernel.org>
To: lee@kernel.org, Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
Uday Khare <udaykhare77@gmail.com>,
Jerome Neanne <jneanne@baylibre.com>,
Mal Nadar <m.nirmaladevi@ltts.com>,
Esteban Blanc <eblanc@baylibre.com>,
linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org
Subject: [PATCH 5/8] regulator: tps6594-regulator: Bind IRQ resources to child platform device
Date: Fri, 27 Nov 2026 18:35:45 +0000 [thread overview]
Message-ID: <20261127183624.3341010-6-lee@kernel.org> (raw)
In-Reply-To: <20261127183624.3341010-1-lee@kernel.org>
tps6594_regulator_probe() and tps6594_request_reg_irqs() allocate IRQ
data and request threaded IRQs using devres attached to the parent MFD
device tps->dev, while registering the regulators with &pdev->dev. If
probe fails partway through or the regulator platform device is unbound,
the regulators are unregistered and freed while the threaded IRQs remain
active with dangling rdev pointers and block subsequent probes.
Attach the devm_kmalloc_objs() allocations and devm_request_threaded_irq()
handlers to &pdev->dev so LIFO devres teardown frees the IRQs before
unregistering the regulators and freeing the IRQ data.
Fixes: f17ccc5deb4d ("regulator: tps6594-regulator: Add driver for TI TPS6594 regulators")
Closes: https://sashiko.dev/#/bug/linux-5557312d-1058-44ee-a8e4-cb48dab3566f
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
drivers/regulator/tps6594-regulator.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/regulator/tps6594-regulator.c b/drivers/regulator/tps6594-regulator.c
index 66052753610f..dab4bd6b0282 100644
--- a/drivers/regulator/tps6594-regulator.c
+++ b/drivers/regulator/tps6594-regulator.c
@@ -549,7 +549,7 @@ static int tps6594_request_reg_irqs(struct platform_device *pdev,
irq_data[*irq_idx].type = irq_type;
irq_data[*irq_idx].rdev = rdev;
- error = devm_request_threaded_irq(tps->dev, irq, NULL,
+ error = devm_request_threaded_irq(&pdev->dev, irq, NULL,
tps6594_regulator_irq_handler, IRQF_ONESHOT,
irq_type->irq_name, &irq_data[*irq_idx]);
if (error) {
@@ -738,7 +738,7 @@ static int tps6594_regulator_probe(struct platform_device *pdev)
reg_irq_nb = desc->num_irq_types * (desc->num_buck_regs + desc->num_ldo_regs);
- irq_data = devm_kmalloc_objs(tps->dev,
+ irq_data = devm_kmalloc_objs(&pdev->dev,
struct tps6594_regulator_irq_data,
reg_irq_nb);
if (!irq_data)
@@ -828,7 +828,7 @@ static int tps6594_regulator_probe(struct platform_device *pdev)
return error;
}
- irq_ext_reg_data = devm_kmalloc_objs(tps->dev,
+ irq_ext_reg_data = devm_kmalloc_objs(&pdev->dev,
struct tps6594_ext_regulator_irq_data,
desc->num_ext_irqs);
if (!irq_ext_reg_data)
@@ -843,7 +843,7 @@ static int tps6594_regulator_probe(struct platform_device *pdev)
irq_ext_reg_data[i].dev = tps->dev;
irq_ext_reg_data[i].type = irq_type;
- error = devm_request_threaded_irq(tps->dev, irq, NULL,
+ error = devm_request_threaded_irq(&pdev->dev, irq, NULL,
tps6594_ext_regulator_irq_handler,
IRQF_ONESHOT,
irq_type->irq_name,
--
2.56.1.839.g22a8290db9-goog
next prev parent reply other threads:[~2026-11-27 18:37 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 18:35 [PATCH 0/8] regulator: Fix locking, OOB read, lifetime, and global state bugs (batch 2) Lee Jones
2026-11-27 18:35 ` [PATCH 1/8] regulator: core: Defer supply cleanup and unregister event forwarding on error Lee Jones
2026-11-27 18:35 ` [PATCH 2/8] regulator: max8907: Duplicate of_regulator_match table per device Lee Jones
2026-11-27 18:35 ` [PATCH 3/8] regulator: tps6594-regulator: Use dedicated handler for external regulator IRQs Lee Jones
2026-11-27 18:35 ` [PATCH 4/8] regulator: tps65910: Fix OOB read and bit shift in external sleep config Lee Jones
2026-11-27 18:35 ` Lee Jones [this message]
2026-11-27 18:35 ` [PATCH 6/8] regulator: core: Respect is_locked when disabling supply on enable failure Lee Jones
2026-11-27 18:35 ` [PATCH 7/8] regulator: of: Guard against NULL device_node in of_regulator_bulk_get_all() Lee Jones
2026-11-27 18:35 ` [PATCH 8/8] regulator: aat2870: Duplicate regulator data per device Lee Jones
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=20261127183624.3341010-6-lee@kernel.org \
--to=lee@kernel.org \
--cc=broonie@kernel.org \
--cc=eblanc@baylibre.com \
--cc=jneanne@baylibre.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=m.nirmaladevi@ltts.com \
--cc=stable@vger.kernel.org \
--cc=udaykhare77@gmail.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®