soc: qcom: ocmem: Fix missing put_device() call in of_get_ocmem
authorMiaoqian Lin <linmq006@gmail.com>
Fri, 7 Jan 2022 07:31:26 +0000 (07:31 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:23:15 +0000 (14:23 +0200)
commit1874365f3c173c8fbe80238e6b89af60f9c54f33
tree3caef10385d267def366938d59936579ab9c2bcc
parent724376c30af5a57686b223dbcd6188e07d2a1de2
soc: qcom: ocmem: Fix missing put_device() call in of_get_ocmem

[ Upstream commit 0ff027027e05a866491bbb53494f0e2a61354c85 ]

The reference taken by 'of_find_device_by_node()' must be released when
not needed anymore.
Add the corresponding 'put_device()' in the error handling path.

Fixes: 01f937ffc468 ("soc: qcom: ocmem: don't return NULL in of_get_ocmem")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20220107073126.2335-1-linmq006@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/soc/qcom/ocmem.c