[PATCH 3/8] regulator: tps6594-regulator: Use dedicated handler for external regulator IRQs
From: Lee Jones
Date: Fri Nov 27 2026 - 13:37:01 EST
External regulator and VMON interrupts are registered with a pointer to
struct tps6594_ext_regulator_irq_data, which has no rdev member, yet
they reuse tps6594_regulator_irq_handler(). That handler casts the
pointer to struct tps6594_regulator_irq_data and reads irq_data->rdev
out of bounds before passing it to regulator_notifier_call_chain().
Add a dedicated tps6594_ext_regulator_irq_handler() that operates on
struct tps6594_ext_regulator_irq_data and logs the trap without calling
regulator_notifier_call_chain().
Fixes: f17ccc5deb4d ("regulator: tps6594-regulator: Add driver for TI TPS6594 regulators")
Closes: https://sashiko.dev/#/bug/linux-e6806c5e-76ed-41e2-924e-7110aa9f7d58
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Lee Jones <lee@xxxxxxxxxx>
---
drivers/regulator/tps6594-regulator.c | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/drivers/regulator/tps6594-regulator.c b/drivers/regulator/tps6594-regulator.c
index 1bbad407acb7..66052753610f 100644
--- a/drivers/regulator/tps6594-regulator.c
+++ b/drivers/regulator/tps6594-regulator.c
@@ -509,6 +509,23 @@ static irqreturn_t tps6594_regulator_irq_handler(int irq, void *data)
return IRQ_HANDLED;
}
+static irqreturn_t tps6594_ext_regulator_irq_handler(int irq, void *data)
+{
+ struct tps6594_ext_regulator_irq_data *irq_data = data;
+
+ if (irq_data->type->event_name[0] == '\0') {
+ /* This is the timeout interrupt no specific regulator */
+ dev_err(irq_data->dev,
+ "System was put in shutdown due to timeout during an active or standby transition.\n");
+ return IRQ_HANDLED;
+ }
+
+ dev_err(irq_data->dev, "Error IRQ trap %s for %s\n",
+ irq_data->type->event_name, irq_data->type->regulator_name);
+
+ return IRQ_HANDLED;
+}
+
static int tps6594_request_reg_irqs(struct platform_device *pdev,
struct regulator_dev *rdev,
struct tps6594_regulator_irq_data *irq_data,
@@ -827,7 +844,7 @@ static int tps6594_regulator_probe(struct platform_device *pdev)
irq_ext_reg_data[i].type = irq_type;
error = devm_request_threaded_irq(tps->dev, irq, NULL,
- tps6594_regulator_irq_handler,
+ tps6594_ext_regulator_irq_handler,
IRQF_ONESHOT,
irq_type->irq_name,
&irq_ext_reg_data[i]);
--
2.56.1.839.g22a8290db9-goog