]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
soc: qcom: ocmem: fix device leak on lookup
authorJohan Hovold <johan@kernel.org>
Fri, 26 Sep 2025 14:35:10 +0000 (16:35 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jan 2026 12:11:52 +0000 (13:11 +0100)
commit359824de51952ee0c2227fb06dffadca98cd4bd9
tree5bb0585869527704c8546be0df890fa463ac40dc
parent8b7629cf55d592e976bb040d0bee95de4fc1f236
soc: qcom: ocmem: fix device leak on lookup

commit b5c16ea57b030b8e9428ec726e26219dfe05c3d9 upstream.

Make sure to drop the reference taken to the ocmem platform device when
looking up its driver data.

Note that holding a reference to a device does not prevent its driver
data from going away so there is no point in keeping the reference.

Also note that commit 0ff027027e05 ("soc: qcom: ocmem: Fix missing
put_device() call in of_get_ocmem") fixed the leak in a lookup error
path, but the reference is still leaking on success.

Fixes: 88c1e9404f1d ("soc: qcom: add OCMEM driver")
Cc: stable@vger.kernel.org # 5.5: 0ff027027e05
Cc: Brian Masney <bmasney@redhat.com>
Cc: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Brian Masney <bmasney@redhat.com>
Link: https://lore.kernel.org/r/20250926143511.6715-2-johan@kernel.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/soc/qcom/ocmem.c