]> git.baikalelectronics.ru Git - kernel.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>
Mon, 31 Jan 2022 13:11:20 +0000 (14:11 +0100)
commit8966aba51ca5c03dcba31929921a81b244fa848e
tree2d688408d9b8d8f05828365c3481fb0f6bc78f86
parent9f60abbd46bd1c8e153a5c7a165b501c4ce91a5d
usb: ulpi: Call of_node_put correctly

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: 7e391dcc7bdc ("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