]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: ulpi: Call of_node_put correctly
authorSean Anderson <sean.anderson@seco.com>
Thu, 27 Jan 2022 19:00:03 +0000 (14:00 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Feb 2022 11:51:46 +0000 (12:51 +0100)
commitd7aa226d3b7706f39e89bf689d03878af75903bb
treecdf1407361a3bc796f81c13e0c18117c4b262b88
parent4395107033a4c6397c669b91eda7c6e31d2ac21a
usb: ulpi: Call of_node_put correctly

commit 0a907ee9d95e3ac35eb023d71f29eae0aaa52d1b upstream.

of_node_put should always be called on device nodes gotten from
of_get_*. Additionally, it should only be called after there are no
remaining users. To address the first issue, call of_node_put if later
steps in ulpi_register fail. To address the latter, call put_device if
device_register fails, which will call ulpi_dev_release if necessary.

Fixes: ef6a7bcfb01c ("usb: ulpi: Support device discovery via DT")
Cc: stable <stable@vger.kernel.org>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Link: https://lore.kernel.org/r/20220127190004.1446909-3-sean.anderson@seco.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/common/ulpi.c