linux/drivers/i3c
Zilin Guan 2537089413 i3c: dw: Fix memory leak in dw_i3c_master_i2c_xfers()
The dw_i3c_master_i2c_xfers() function allocates memory for the xfer
structure using dw_i3c_master_alloc_xfer(). If pm_runtime_resume_and_get()
fails, the function returns without freeing the allocated xfer, resulting
in a memory leak.

Add a dw_i3c_master_free_xfer() call to the error path to ensure the
allocated memory is properly freed.

Compile tested only. Issue found using a prototype static analysis tool
and code review.

Fixes: 62fe9d06f5 ("i3c: dw: Add power management support")
Signed-off-by: Zilin Guan <zilin@seu.edu.cn>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260126081121.644099-1-zilin@seu.edu.cn
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
History 2026-01-31 00:03:46 +01:00
..
master i3c: dw: Fix memory leak in dw_i3c_master_i2c_xfers() 2026-01-31 00:03:46 +01:00
device.c i3c: master: Introduce optional Runtime PM support 2026-01-14 17:21:10 +01:00
internals.h i3c: master: Introduce optional Runtime PM support 2026-01-14 17:21:10 +01:00
Kconfig i3c: Add core I3C infrastructure 2018-11-12 10:33:49 +01:00
Makefile i3c: Add core I3C infrastructure 2018-11-12 10:33:49 +01:00
master.c i3c: master: Add i3c_master_do_daa_ext() for post-hibernation address recovery 2026-01-31 00:02:24 +01:00