lkml.org 
[lkml]   [2021]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] usb: phy: add missing put_device() call in tegra_usb_phy_parse_pmc()
From
Date
07.12.2021 15:56, Qing Wang пишет:
> From: Wang Qing <wangqing@vivo.com>
>
> of_find_device_by_node() takes a reference to the embedded struct device
> which needs to be dropped when error return.
>
> Add a jump target to fix the exception handling for this
> function implementation.
>
> Signed-off-by: Wang Qing <wangqing@vivo.com>
> ---
> drivers/usb/phy/phy-tegra-usb.c | 18 +++++++++++++-----
> 1 file changed, 13 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/usb/phy/phy-tegra-usb.c b/drivers/usb/phy/phy-tegra-usb.c
> index 68cd4b6..5678b7f
> --- a/drivers/usb/phy/phy-tegra-usb.c
> +++ b/drivers/usb/phy/phy-tegra-usb.c
> @@ -1300,18 +1300,26 @@ static int tegra_usb_phy_parse_pmc(struct device *dev,
> err = devm_add_action_or_reset(dev, tegra_usb_phy_put_pmc_device,
> &pmc_pdev->dev);

This devm_add_action_or_reset() takes care of dropping the reference.
This patch is incorrect.

\
 
 \ /
  Last update: 2021-12-07 15:12    [W:0.049 / U:1.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site