summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYang Yingliang <yangyingliang@huawei.com>2022-10-29 19:16:26 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-01-18 11:30:31 +0100
commit6d984a9da44178a7aab11a9dc011d127aabbeb0b (patch)
tree2b4d946ff0415780a03ef278d724b7eea3e3edc4
parent45012bd3c8281248a014501bb0e655bf6904f065 (diff)
downloadlinux-stable-6d984a9da44178a7aab11a9dc011d127aabbeb0b.tar.gz
linux-stable-6d984a9da44178a7aab11a9dc011d127aabbeb0b.tar.bz2
linux-stable-6d984a9da44178a7aab11a9dc011d127aabbeb0b.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>
-rw-r--r--arch/powerpc/platforms/83xx/mpc832x_rdb.c2
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 438986593873..bfebfc67b23f 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: