Subject: CVE-2022-48656: dmaengine: ti: k3-udma-private: Fix refcount leak bug in of_xudma_dev_get()

From: Greg Kroah-Hartman <[email-masked]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

dmaengine: ti: k3-udma-private: Fix refcount leak bug in of_xudma_dev_get()

We should call of_node_put() for the reference returned by
of_parse_phandle() in fail path or when it is not used anymore.
Here we only need to move the of_node_put() before the check.

The Linux kernel CVE team has assigned CVE-2022-48656 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 5.6 with commit d70241913413 and fixed in 5.10.146 with commit aa11dae059a4
	Issue introduced in 5.6 with commit d70241913413 and fixed in 5.15.71 with commit dd5a6c5a0875
	Issue introduced in 5.6 with commit d70241913413 and fixed in 5.19.12 with commit a17df55bf6d5
	Issue introduced in 5.6 with commit d70241913413 and fixed in 6.0 with commit f9fdb0b86f08

Please see https://www.kernel.org for a full list of currently supported
kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to
older supported kernel versions.  The official CVE entry at
	https://cve.org/CVERecord/?id=CVE-2022-48656
will be updated if fixes are backported, please check that for the most
up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
	drivers/dma/ti/k3-udma-private.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest
stable kernel version for this, and many other bugfixes.  Individual
changes are never tested alone, but rather are part of a larger kernel
release.  Cherry-picking individual commits is not recommended or
supported by the Linux kernel community at all.  If however, updating to
the latest release is impossible, the individual changes to resolve this
issue can be found at these commits:
	https://git.kernel.org/stable/c/aa11dae059a439af82bae541b134f8f53ac177b5
	https://git.kernel.org/stable/c/dd5a6c5a08752b613e83ad2cb5133e72a64b876d
	https://git.kernel.org/stable/c/a17df55bf6d536712da6902a83db82b82e67d5a2
	https://git.kernel.org/stable/c/f9fdb0b86f087c2b7f6c6168dd0985a3c1eda87e