diff options
author | Yang Yingliang <yangyingliang@huawei.com> | 2022-10-29 19:16:26 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-01-18 09:26:27 +0100 |
commit | 655ed7d7316635bba0985e890cd8970447a3ad72 (patch) | |
tree | 5558066703b456f4c25f4c2108e318e3af064714 /arch | |
parent | 2bf6235bcf9612203beb35f20fbe6d686c7a637e (diff) | |
download | linux-stable-655ed7d7316635bba0985e890cd8970447a3ad72.tar.gz linux-stable-655ed7d7316635bba0985e890cd8970447a3ad72.tar.bz2 linux-stable-655ed7d7316635bba0985e890cd8970447a3ad72.zip |
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: 26f6cb999366 ("[POWERPC] fsl_soc: add support for fsl_spi")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20221029111626.429971-1-yangyingliang@huawei.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/platforms/83xx/mpc832x_rdb.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/83xx/mpc832x_rdb.c b/arch/powerpc/platforms/83xx/mpc832x_rdb.c index a4539c5accb0..8c31c3275b66 100644 --- a/arch/powerpc/platforms/83xx/mpc832x_rdb.c +++ b/arch/powerpc/platforms/83xx/mpc832x_rdb.c @@ -111,7 +111,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: |