[PATCH v3] bus: fsl-mc: fix an error handling in fsl_mc_device_add()
Ioana Ciornei
ioana.ciornei at nxp.com
Wed Jan 28 23:15:02 AEDT 2026
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 at vger.kernel.org
> Reported-by: Dan Carpenter <dan.carpenter at linaro.org>
> Closes: https://lore.kernel.org/all/b767348e-d89c-416e-acea-1ebbff3bea20@stanley.mountain/
> Signed-off-by: Su Hui <suhui at nfschina.com>
> Suggested-by: Christophe Leroy (CS GROUP) <chleroy at kernel.org>
> Signed-off-by: Haoxiang Li <lihaoxiang at isrc.iscas.ac.cn>
Reviewed-by: Ioana Ciornei <ioana.ciornei at nxp.com>
More information about the Linuxppc-dev
mailing list