The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH 0/2] regmap: Fix bus context frees on init failure
@ 2026-11-30 20:21 Arun Iyengar via B4 Relay
  2026-11-30 20:21 ` [PATCH 1/2] regmap: Don't free the bus context when devm init fails Arun Iyengar via B4 Relay
  2026-11-30 20:21 ` [PATCH 2/2] regmap: mmio: Free the context if regmap " Arun Iyengar via B4 Relay
  0 siblings, 2 replies; 3+ messages in thread
From: Arun Iyengar via B4 Relay @ 2026-11-30 20:21 UTC (permalink / raw)
  To: Mark Brown
  Cc: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
	Johan Hovold, Krzysztof Kozlowski, linux-kernel, driver-core,
	Guenter Roeck, linux-hwmon, Xu Yilun, Arun Iyengar

Since b1ef855c6260, a failing __devm_regmap_init() can free the bus
context, so spi-avmm and sch56xx free it twice. Patch 1 restores the
old behaviour. Patch 2 fixes the mmio context leak on init failure.

Tested with failslab on an Orange Pi 5 (devm mmio regmap): kmemleak
finds the mmio leak, and with patch 2 alone KASAN reports the double
free. With both patches, no reports. spi-avmm and sch56xx were not run.

Developed with Claude (Anthropic), which wrote the code and the commit
messages. I reviewed every change.

---
Arun Iyengar (2):
      regmap: Don't free the bus context when devm init fails
      regmap: mmio: Free the context if regmap init fails

 drivers/base/regmap/regmap-mmio.c | 18 ++++++++++++++----
 drivers/base/regmap/regmap.c      | 20 ++++++++++++--------
 2 files changed, 26 insertions(+), 12 deletions(-)
---
base-commit: 222b61e9c570dac6c7a786d039e4c226624b426d
change-id: 20261129-regmap-devm-ctx-2955bb2c1077

Best regards,
--  
Arun Iyengar <aiyengar1990@gmail.com>



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-30 20:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-30 20:21 [PATCH 0/2] regmap: Fix bus context frees on init failure Arun Iyengar via B4 Relay
2026-11-30 20:21 ` [PATCH 1/2] regmap: Don't free the bus context when devm init fails Arun Iyengar via B4 Relay
2026-11-30 20:21 ` [PATCH 2/2] regmap: mmio: Free the context if regmap " Arun Iyengar via B4 Relay

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox