Re: [PATCH] i3c: master: Skip IDR cleanup if bus ID allocation fails

From: Alexandre Belloni

Date: Wed Dec 02 2026 - 16:55:26 EST


On Mon, 16 Nov 2026 11:53:17 +0800, Zhang Yuwei wrote:
> Since commit 9d4f219807d5 ("i3c: fix refcount inconsistency in
> i3c_master_register"), an i3c_bus_init() failure is handled by dropping
> the initialized device reference. This invokes i3c_masterdev_release(),
> which unconditionally calls i3c_bus_cleanup().
>
> However, i3c_bus_init() only assigns the bus ID after idr_alloc()
> succeeds. If the allocation fails, a zero-initialized controller retains
> a bus ID of zero, and i3c_bus_cleanup() removes ID zero from the IDR.
> If another bus owns that ID, its mapping is incorrectly removed, allowing
> the ID to be reused while that bus is still registered.
>
> [...]

Applied, thanks!

[1/1] i3c: master: Skip IDR cleanup if bus ID allocation fails
https://git.kernel.org/i3c/c/9ef8ebc89cb0

Best regards,

--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com