Re: [PATCH v3] bus: fsl-mc: fix an error handling in fsl_mc_device_add()
From: Ioana Ciornei
Date: Wed Jan 28 2026 - 07:15:48 EST
On Sat, Jan 24, 2026 at 06:20:54PM +0800, Haoxiang Li wrote:
> In fsl_mc_device_add(), device_initialize() is called first.
> put_device() should be called to drop the reference if error
> occurs. And other resources would be released via put_device
> -> fsl_mc_device_release. So remove redundant kfree() in
> error handling path.
>
> Fixes: bbf9d17d9875 ("staging: fsl-mc: Freescale Management Complex (fsl-mc) bus driver")
> Cc: stable@xxxxxxxxxxxxxxx
> Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> Closes: https://lore.kernel.org/all/b767348e-d89c-416e-acea-1ebbff3bea20@stanley.mountain/
> Signed-off-by: Su Hui <suhui@xxxxxxxxxxxx>
> Suggested-by: Christophe Leroy (CS GROUP) <chleroy@xxxxxxxxxx>
> Signed-off-by: Haoxiang Li <lihaoxiang@xxxxxxxxxxxxxxxx>
Reviewed-by: Ioana Ciornei <ioana.ciornei@xxxxxxx>