Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aed86289 authored by Yang Yingliang's avatar Yang Yingliang Committed by Greg Kroah-Hartman
Browse files

powerpc/83xx/mpc832x_rdb: call platform_device_put() in error case in of_fsl_spi_probe()



[ Upstream commit 4d0eea415216fe3791da2f65eb41399e70c7bedf ]

If platform_device_add() is not called or failed, it can not call
platform_device_del() to clean up memory, it should call
platform_device_put() in error case.

Fixes: 26f6cb99 ("[POWERPC] fsl_soc: add support for fsl_spi")
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20221029111626.429971-1-yangyingliang@huawei.com


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent d539b77b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -107,7 +107,7 @@ static int __init of_fsl_spi_probe(char *type, char *compatible, u32 sysclk,

		goto next;
unreg:
		platform_device_del(pdev);
		platform_device_put(pdev);
err:
		pr_err("%pOF: registration failed\n", np);
next: