Re: [PATCH 0/2] regmap: Fix bus context frees on init failure
From: Peng Fan
Date: Tue Dec 01 2026 - 08:42:54 EST
On Mon, Nov 30, 2026 at 08:21:20PM +0000, Arun Iyengar wrote:
>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
>
Reviewed-by: Peng Fan <peng.fan@xxxxxxx>