Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

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

authored by

Yang Yingliang and committed by
Michael Ellerman
4d0eea41 22db71bc

+1 -1
+1 -1
arch/powerpc/platforms/83xx/mpc832x_rdb.c
··· 107 107 108 108 goto next; 109 109 unreg: 110 - platform_device_del(pdev); 110 + platform_device_put(pdev); 111 111 err: 112 112 pr_err("%pOF: registration failed\n", np); 113 113 next: